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
Kon DeleKon Dele 

Help with Apex Trigger that updates Account picklist.

Hello,
I'm new to coding and have been presented with the following task.
Create a trigger that runs each time an account is created or edited that updates a custom account picklist (Cold,Warm,Hot)as follows:
  1) If there are 3 or fewer contacts update to Cold
  2) if there are 4 to 9 contacts update to Warm
  3) if there are 10 or more contacts Hot
I need help with designing the trigger syntax. Thanks
Best Answer chosen by Kon Dele
VikashVikash (Salesforce Developers) 
Hi,

Please follow the links to understand in details about Triggers
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_HelloWorld.htm
http://help.salesforce.com/apex/HTViewHelpDoc?id=code_define_trigger.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables_considerations.htm
https://developer.salesforce.com/page/Apex_Code_Best_Practices

Hope this helps you.

Thanks
Vikash_SFDC