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
Please try below code. But please create one integer custom field on account to store the value.
trigger AccountTrigger on Account (before update) {
for (Account eachAccount: Trigger.new) {
String newAccountName = (Trigger.newMap.get(eachAccount.Id)).Name;
String oldAccountName = (Trigger.oldMap.get(eachAccount.Id)).Name;
if(!newAccountName.equals(oldAccountName)){
// you update your count Account.Custom_Count_Field
eachAccount.custom_count_field=eachAccount.custom_count_field+1;
}
}
}
Regards,
Pawan Kumar