function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger AccountTrigger on Account (before update) { for(Account Acc : Trigger.new) { if(Acc.Name != trigger.OldMap.get(Acc.Id).Name){ Acc.Name.AddError('Account Name Cannot be Changed.'); } } } ################################################################ You Can Also Try VAlidation Rule ISCHANGED(Name)
Thank You!
trigger AccountNameTrigger on Account (before update) {
if(Trigger.isUpdate && Trigger.isBefore)
{
for(Account AccountObj : Trigger.new) {
if(AccountObj.Name != trigger.OldMap.get(AccountObj.Id).Name){
AccountObj.addError('Sorry! You can\'t change the account name');
}
}
}
}
I hope you find the above solution helpful. If it does, please mark it as the Best Answer to help others too.
Thanks and Regards,
Suraj Tripathi