User Story
Create a trigger that updates description when the name of an Account is updated.
Code
trigger AccountTrigger on Account (before update) {
for (Account acc : trigger.old) {
if (acc.Name != trigger.newMap.get(acc.Id).Name) {
acc.Description = 'Account name changed from ' + acc.Name + ' to ' + trigger.newMap.get(acc.Id).Name;
}
}
}
Video
Video does not exists.