Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. public static void createProduct(String name, Id recordTypeId) {
  2. Product2 product = new Product2(
  3. Name = name,
  4. ISIN__c = '001test',
  5. RecordTypeId = recordTypeId,
  6. Issuer__c = getAccountIssuerId(),
  7. Product_subtype__c = Constants.SYBTUPE_FOR_EXPRESS_CERTIFICATE[0],
  8. Underlying_type__c = Constants.UNDERLYINGTYPE_SINGLE_PICKLIST_API_NAME,
  9. Multichance__c = 'multiTest',
  10. Maturity__c = 12,
  11. Issue_Date__c = System.today(),
  12. Initial_Fixing_Date__c = System.today(),
  13. Final_Fixing_Date__c = System.today().addMonths(12),
  14. Redemption_Date__c = System.today().addMonths(13),
  15. Issue_price__c = 13.22,
  16. Barrier_type__c = Constants.BARRIERTYPE_EUROPEAN_PICKLIST_API_NAME,
  17. Barrier_level__c = 12.22,
  18. Maximum_Redemption__c = 11.10,
  19. Coupon_p_a__c = 10.01,
  20. Frequency__c = Constants.FREQUENCY_QUARTERLY_PICKLIST_API_NAME,
  21. Coupon_type__c = Constants.COUPONTYPE_CONDITIONALWITHMEMORY_PICKLIST_API_NAME,
  22. Coupon_trigger__c = 11.11,
  23. Call_type__c = Constants.CALLTYPE_AUTOCALL_PICKLIST_API_NAME,
  24. Autocall_trigger__c = 3.25,
  25. First_call_in__c = 3,
  26. Call_rate__c = 4.48,
  27. CurrencyIsoCode = 'UYU'
  28. );
  29.  
  30. insert product;
  31. }
  32.  
  33. public static void createProductExpressCertificateRTWithOutUnderlying() {
  34. createProduct('TestProduct1', Utills.schemaGetObjectRecordTypeIdByDeveloperName('Product2', Constants.PRODUCT_EXPRESSCERTIFICATE_RECORDTYPE_API_NAME));
  35. }
  36.  
  37. public static void createProductExpressCertificateRTWithUnderlying() {
  38. createProduct('TestProduct2', Utills.schemaGetObjectRecordTypeIdByDeveloperName('Product2', Constants.PRODUCT_EXPRESSCERTIFICATE_RECORDTYPE_API_NAME));
  39. }
  40.  
  41. public static Id getProductIdWithOutUnderlying() {
  42. Product2 product = [
  43. SELECT Id
  44. FROM Product2
  45. WHERE Name = 'TestProduct1'
  46. ];
  47. return product.Id;
  48. }
  49.  
  50. public static Id getProductIdWithUnderlying() {
  51. Product2 product = [
  52. SELECT Id
  53. FROM Product2
  54. WHERE Name = 'TestProduct2'
  55. ];
  56. return product.Id;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement