You need to sign in to do that
Don't have an account?
regarding apex trigger
My requirement as follows...
1. There are 2 fields on Oppty - Stage and Disposition Reason. Disposition Reason is dependent on Stage. (already built)
2. The following action should happen whenever Stage is any of the values with the word "Closed", so closed won, closed lost etc.
3. Say I choose Stage as Closed Won, and Disposition as Cyhicle.
4. On the Oppty Prod Line item related list i.e (Products), all products where Primary Quote = TRUE, the Stage and Disposition Reason should be updated with the values chosen on the Oppty. Please note ALL line items should be updated and the condition is Primary Quote field is checked. So, prodcut should also have Stage as Closed Won, and Disposition as Cycle.
Hint - there should be a apex trigger written on the Oppty Object and it should run on AFTER INSERT and AFTER UPDATE functions.
Thanks
Rekha
Hi Rekha,
Ther are two ways to achive this
1) Use 2 formula fields (Most preffered)
For your formula field "Stage" in Opportunity Product
Formula for "Disposition Reason" field in Opportunity Products
2)Use the Apex trigger as below (not likely to be preffered)
Here is the code. Change the field names as necessary
Hope this helps
Cheers...
All Answers
Hi Rekha,
Ther are two ways to achive this
1) Use 2 formula fields (Most preffered)
For your formula field "Stage" in Opportunity Product
Formula for "Disposition Reason" field in Opportunity Products
2)Use the Apex trigger as below (not likely to be preffered)
Here is the code. Change the field names as necessary
Hope this helps
Cheers...
Hi....:smileysurprised:
Thanks for u r solution ,
according to your example i did modifications for my requirement
Very Very Thanks..............