Write a trigger on Account Whenever New Account Record is created, then needs to create associated Contact Record Automatically with Account name as Contact LastName and Account Phone as Contact Phone in Salesforce | Apex Trigger Create Related Contact whenever new Account is created in Salesforce

Create Apex Trigger →

Step 1:- Create Apex Trigger : accountContactTrigger.apxt

accountContactTrigger.apxt [Apex Trigger]

What is an apex trigger?

Apex triggers enable you to perform custom actions before or after changes to Salesforce records, such as insertions, updates, or deletions. A trigger is Apex code that executes before or after the following types of operations: insert. update.

What is the use of Apex triggers?

Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. Just like database systems support triggers, Apex provides trigger support for managing records.

Can we write two triggers on same object?

Writing multiple triggers renders the system unable to recognize the order of execution. Moreover, each trigger that is invoked does not get its own governor limits. Instead, all code that is processed, including the additional triggers, share those available resources.

Final Output → To get source code live demo..

--

--

Easy to learn step-by-step online tutorial by www.w3web.net

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vijayk

Vijayk

Easy to learn step-by-step online tutorial by www.w3web.net