Category Archives: Triggers

Cron Trigger in Salesforce

Any job that is scheduled in the salesforce will be registered or CronTrigger object (which is available from version 17 and later). If you want to know the status of the job, we can write a SOQL on CronTrigger object using jobid generated by system.schedule( ) method invocation. Syntax: cronTrigger cron = [select id,cronExpression from… Read More »

Share this...
Share on Facebook
Facebook
Email this to someone
email

Order of Execution of Trigger in Salesforce

Hi guys, here we are going to learn about order of execution of triggers in salesforce. Original record is loaded from the database. New record overwrites old values. System validation rules. All Apex before triggers. Custom validation rules. Record saved to database. [but not committed] Record reloaded from database. All Apex after triggers. Assignment rules.… Read More »

Share this...
Share on Facebook
Facebook
Email this to someone
email

Trigger with Test class for When Account is created with AnnualRevenue more than 50 Lacs and Industry is Energy then create a new opportunity

Hi, Here we have witten Trigger for, When ever a new Account is created with Annual Revenue more than 50Lacs and Industry as Energy then create a new opportunity for this account with OpportunityName as AccountName StageName as Prospecting CloseDate as Today+30 days Trigger Code Test Class for this Trigger This is Test class for… Read More »

Share this...
Share on Facebook
Facebook
Email this to someone
email