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
Sarah RobertsonSarah Robertson 

A trigger which fires when you create an account, but before the user enters data and saves the record.

Hi 

I was wondering if someone might be able to help me with this requirement. I was looking to have a trigger which enters a value for a picklist field but was stuck on the event condition. What i wanted to happen is for when the user creates an account and the blank form loads for that field to be populated, but before the user enters their own data and then saves. If that makes sense ? Is it possible ? 

Thank you 

 

James LoghryJames Loghry
It sounds like what you're looking for is more of a quick action.  In particular an object specific quick action.  Check out the trailhead module on creating object specific quick actions here: https://trailhead.salesforce.com/en/salesforce1_mobile_app/salesforce1_mobile_app_actions_objectspecific
Israel (Izzy) BoydIsrael (Izzy) Boyd
trigger <name> on <object> (before insert){}
-You mention that a user is creating an account. This means insert, although you might want this trigger fired on update as well.
-Also, use the before condition. 95% of the time use before. If it's wrong, SFDC will let you know. Change it then. But, rule of thumb is that you'll use the before condition unless you need to access id, and other system information that is only accessible after the save event happens.