You need to sign in to do that
Don't have an account?

Apex trigger to update Account "Tier" when the Opportunity Stage equals Closed Won
I am new to Apex triggers. Can anyone help me writing the Trigger for updating a customised Account "Tier" field to Tier 1,2,3 or 4 when the Opportunity Stage is equal to 'Closed Won' and the Tier number is determined by the number of products purchased on the Opportunity e.g. Tier 1 = 10000+,Tier 2 = 5000-10000, Tier 3=2500-4999,Tier 4=<2500?
Thanks in advance.
Thanks in advance.
All Answers
Please try Below Example And Please update Code According To my Comment.\ Please let me know if you are facing any issue.
If it works for you then PLEASE MARK THIS SOLVED.
Thank you for your quick reply. I should have been more precise with my terminology - "number of products purchased" this is just a custom field on an Opportunity that we use to identify the quantity of products that we have sold. How will this change the Trigger that you kindly provided?
Thank you again and apologies for the lack of clarity.
David
Error: Compile Error: Missing closing quote character ' on string. at line 23 column 46 i.e. the // oAcc.Tier__c = '