You need to sign in to do that
Don't have an account?
khalid ameen 9
If an account has a rating then the user can’t change the account rating.
i want to write a trigger on it
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You
try below code
// Call helper calss from Trigger in before udpate event
AccountTriggerHelper.checkRatiing(Trigger.newMap, Trigger.oldMap);
//Helper class Method
public static void checkRatiing(Map<Id, Account> newMap, Map<Id, Account> oldMap) {
for (Account acc : newMap.values()) {
if (acc.Rating != null && acc.Rating != oldMap.get(acc.Id).Rating) {
acc.addError( 'User can’t change the account rating' );
}
}
}
Thanks,
Shatrughna
Khalid
you can use this trigger :
you can get references from this :
https://salesforce.stackexchange.com/questions/170716/making-a-field-as-un-editable-conditionally
If you find your Solution then mark this as the best answer
Thank you!
Regards,
Suraj Tripathi