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
MSVRadMSVRad 

Auto Create Case based on Account picklist Value

I need to write a trigger I am guessing to auto create a case when a user changes an account picklist value from one value to another.

 

My question: would this trigger be "on Account" or "on Case"? My guess is "on Case(after Insert, after Update) but I am not sure if this is correct.

 

Along with the autocreation of a case a few fields need to be populated based on an account field as well.

 

Here is the scenario:

 

A user edits an account and they change the custom picklist field "Operational Status" from "ITGO" to "Operational" and clicks save.

 

Then a case needs to be created pulling in the related accout as a lookup, the owner of the case needs to be set based on the custom account picklist field "Customer Service Rep" and the Type field will be set to "Health Check".

 

Does anyone have any suggestions for this trigger?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
PragadheeshwariPragadheeshwari

Hai,

   you have to write a trigger in account(after update),here create the case with your values.

All Answers

PragadheeshwariPragadheeshwari

Hai,

   you have to write a trigger in account(after update),here create the case with your values.

This was selected as the best answer
FliegelFliegel

Hi -

 

Were you able to create a trigger for this functionality? I have a similar use case where I need to have a case created base on an Opportunity picklist value. Do you mind sharing the trigger code you used?

 

Thank you very much.