function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KavitaKavita 

Calculate Opportunity product line item price based on line above

I have 2 product line items

 

1) License Fee

2) Maintenance Fee which is 10% of the License Fee

 

I would to automate the process so that Sales Price of Item 2 to automatically calculate at 10% of the line item above.

 

Is this possible? If so, how?

 

I would love some help on this.

 

Thanks in advance

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Venkat PolisettVenkat Polisett

There are tons of examples in the discussion boards and in the docs.

 

Come up with your code and post it here and if you have issues, then we can help.

All Answers

Venkat PolisettVenkat Polisett
You could put a "before insert" and "before update" trigger on opportunitylineitem object in which you check for the existance of "License fee" product and update the "Maintenance Fee" product with the new calculated sales price i.e., 10% of License fee.
KavitaKavita

Is there a sample trigger I could look at? I'm horrendous with writing triggers

Venkat PolisettVenkat Polisett

There are tons of examples in the discussion boards and in the docs.

 

Come up with your code and post it here and if you have issues, then we can help.

This was selected as the best answer