Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. this.theProductToInsert.IsActive = true;
  2.  
  3. insert this.theProductToInsert;
  4.  
  5. PriceBookEntry thePriceBookEntry = new PriceBookEntry(
  6. IsActive = true,
  7. Pricebook2Id = this.thePriceBook.Id,
  8. Product2Id = this.theProductToInsert.Id,
  9. UnitPrice = 1
  10. );
  11.  
  12. insert thePriceBookEntry;
  13.  
  14. System.debug('*** thePriceBookEntry: ' + thePriceBookEntry);
  15.  
  16. insert new OpportunityLineItem(
  17. OpportunityId = this.theOpportunity.Id,
  18. PricebookEntryId = thePriceBookEntry.Id,
  19. Quantity = this.theOpportunityLineItem.Quantity,
  20. UnitPrice = this.theOpportunityLineItem.UnitPrice,
  21. Status__c = this.theOpportunityLineItem.Status__c,
  22. Lead_time__c = this.theOpportunityLineItem.Lead_time__c
  23. );
  24.  
  25. thePricebookEntry.CurrencyIsoCode = this.theOpportunity.CurrencyIsoCode;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement