You need to sign in to do that
Don't have an account?
Shubhangi Jadhav
How i can write trigger to get old value of order status
if order status is cancelled it should not be editable by user
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
for(Order od: trigger.old) {
system.debug(od.Status);
}
You might want to consider using a validation rule for your scenario like
AND (
ISPICKVAL(Status,'Cancelled'),
OR(
ISCHANGED(Field1),
ISCHANGED(Field2),
etc,etc
),
!$Setup.HierarchyCustom_Setting__c.ProfileName
)
So if any of the Field1, Field2, etc, etc value is changed by a profile except the profile ProfileName(if you need this) it will display an error message.
Related: https://developer.salesforce.com/forums/?id=906F00000005JWuIAM
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you