You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a trigger to update parent account phone number whenever the contact phone number is updated using trigger handler and helper class in Salesforce
#14
Open
vijayk3327 opened this issue
Aug 27, 2023
· 0 comments
In this post we are going to learn about How to Write a trigger to update parent account phone number when ever the contact phone number is updated using trigger handler and helper class in Salesforce
Real time scenarios:- Write a trigger on Contact to update the parent Account Phone number when ever the Contact Phone is updated through trigger handler and helper class in Salesforce.
Create Apex Class Trigger
Step 1:- Create Apex Class : contactTrigger.apxt
`TRIGGER contactTrigger ON Contact (BEFORE INSERT, BEFORE UPDATE, BEFORE DELETE, after INSERT, after UPDATE, after DELETE, after undelete) {
IF(TRIGGER.isBefore ){
system.debug('I am before trigger ');
}
ELSE IF(TRIGGER.isAfter){
system.debug('I am after trigger ');
IF(TRIGGER.isUpdate){
contactTriggerHandler.afterUpdateHelper(TRIGGER.new);
}
}
In this post we are going to learn about How to Write a trigger to update parent account phone number when ever the contact phone number is updated using trigger handler and helper class in Salesforce
Real time scenarios:- Write a trigger on Contact to update the parent Account Phone number when ever the Contact Phone is updated through trigger handler and helper class in Salesforce.
👉 To get source code live demo link, Click Here.
Create Apex Class Trigger
Step 1:- Create Apex Class : contactTrigger.apxt
`TRIGGER contactTrigger ON Contact (BEFORE INSERT, BEFORE UPDATE, BEFORE DELETE, after INSERT, after UPDATE, after DELETE, after undelete) {
}`
👉 To get source code live demo link, Click Here.
The text was updated successfully, but these errors were encountered: