Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger AUTOADDPRODUCT on OpportunityLineItem (after insert) {
- List<OpportunityLineItem> OpportunityLineItems = new List<OpportunityLineItem>();
- for (OpportunityLineItem newOpportunityLineItems: Trigger.New) {
- if(newOpportunityLineItems.Name == 'CarOIL'){
- OpportunityLineItems.add(new OpportunityLineItem(PricebookEntryId ='ID CODE FOR CarOILplus',Quantity = 1,UnitPrice = 25));
- }
- }
- if(!OpportunityLineItems.isEmpty()){
- insert OpportunityLineItems;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement