Before insert in Salesforce

Handler class
-------------
public class BeforeInsert
{
public static void doOperation(List accList)
{
for(Account a:accList)
{
//accList is a collection of new records.
a.Site='brahmanaidu';
//accessing the field name with reference variable name
}
}
}
Trigger
----------
Trigger AccountTrigger on Account(before insert)
{
BeforeInsert.doOperation(Trigger.new);
//This trigger will be fired when ever the user creates an account record
//By default site value is set to brahmanaidu
//Salesforce will allows to enter the site value but it's not stored in the data base

}

Comments

  1. Hello! Can you please upload how to override Standard new button in Lead object with Lightning Component.


    Thanks

    ReplyDelete

Post a Comment