You need to sign in to do that
Don't have an account?
Prakki
How to restrict user to not to enter values or how to make field as readonly with help of trigger
Hello,
Can anyone please share trigger code to restrict user to not enter values in the field as per condition.
Its a bit urgent.
Prompt responses will be higly appreciated.
Thank you.
Hi
lets say object is customObj__C and field is anyfield__c which we need to make not editable by user is there a condition met isRestricked__c is TRUE then
user following code. ( Here you can manupulate code according to your restricting condition)
for(customObj cobj : Trigger.New)
{
if(cObj.anyfield__c != Trigger.oldMap.get(cobj.id).anyfield__c && u.isRestricked == true )
{
Trigger.AddError('you are not allowed to do this');
}
}