Hi Hari Try this one. trigger ContactBeforeUpdate on Contact (before update) { // Trigger.New hold new version of Contacts for(Contact contact: Trigger.new){ contact.Description = ‘Contact updated successfully by ‘+ userInfo.getUserName() ; } // No Need to write DML statement, trigger. New will be take care. } If it helps,Pleaase mark it as the best answer,Thank you.
See the trigger code on https://developer.salesforce.com/forums/?id=9060G0000005WabQAE which is for a similar ask as yours.
Also see https://salesforce.stackexchange.com/questions/221414/trigger-on-user-when-contactid-changes-then-update-contact-user-c
If this information helps, please mark the answer as best. Thank you
Try this one.
trigger ContactBeforeUpdate on Contact (before update) {
// Trigger.New hold new version of Contacts
for(Contact contact: Trigger.new){
contact.Description = ‘Contact updated successfully by ‘+ userInfo.getUserName() ;
}
// No Need to write DML statement, trigger. New will be take care.
}
If it helps,Pleaase mark it as the best answer,Thank you.