Category: Apex Triggers
-
Trigger to Post Automated Random Chatter Comment
Apex Trigger to post an automated random comment whenever a chatter post is published. When any user posts to chatter and if the user’s post contains the term “Success”, an automated comment should be posted. This comment should be randomly selected from a list of comments; And should be posted as a specific user.
-
Learn Salesforce Triggers with Examples and Scenarios
Learn Salesforce Apex Triggers with examples and scenarios by dissecting them line by line. This List of Salesforce Triggers is for beginners to practice and learn.
-
Trigger to Roll Up (Summary) Contacts field to Accounts
Trigger to Roll Up (Summary) Contacts field to Accounts. The Total Salary field should hold the sum of Salaries from its associated Contacts. The trigger should work whenever a Contact’s Salary is updated, New Contact is Created or when an existing Contact is deleted. Get a List of Accounts that needs to be updated. 1.…
-
Trigger to change the Stage when Opportunity is Created – Triggers for Beginners
Salesforce Apex Trigger to change the Stage/default the stage to ‘Prospecting’ when an Opportunity is created. In other words, when an Opportunity is created by selecting any Stage, the Stage should default back to Prospecting.
-
Trigger to create task when Opportunity is updated – Salesforce Apex Triggers
Salesforce Apex Trigger to create a Task when an Opportunity is updated. The task should be assigned to the Opportunity owner and the status of the task should be “In Progress”. – Salesforce Apex Trigger Examples
-
Write Your First Hello World Salesforce Apex Trigger – Triggers for Beginners
Let’s write our first “Hello World” Salesforce Apex trigger which will update a Lead with “Hello” as the first name and World” as the last name. The “Hello World” program is the simplest program used to illustrate the basic syntax of a programming language. The program outputs “Hello World” and is traditionally the first program…
-
Trigger to Prevent Duplicate Contacts Using Email or Phone Number
Salesforce Apex Trigger to Prevent the user from creating Duplicate Contacts when a Contact already exists with the same Email or Phone number – Triggers for Beginners