Skip to content

July 11, 2015

Where in Salesforce to create a trigger

by Joe Kuan

There are two ways to create a trigger in Salesforce page; Setup or Developer Console

screen

screen

 

In the setup, open the folder ‘App Setup’ -> Customize. Select the Salesforce standard component and click on the Triggers menu. Click on ‘New’ to create a trigger.

 

 

 

In the developer console, selects File -> New -> Apex Trigger

screen

A dialog box appears for the trigger name and a list of Salesforce standard objects for the trigger to apply. Lets create a trigger, UpsertOpportunityTypeCheck, applying to Opportunity objects:

screen

We can enter the Apex code to the main console screen and select ‘File -> Save’. This will send the code to the Salesforce cloud and compile the code. If any errors, this will appear in the ‘Problems’ tab. Once the trigger is compiled fine, we can see that trigger in ‘App Setup’ -> Develop -> Triggers. To modify the trigger name, simple change the name in the trigger code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments

%d bloggers like this: