You need to sign in to do that
Don't have an account?

How to restrict user to not to enter values or how to make field as readonly by using 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.
You can do the same with a validation rule, but I presume you have a reason for asking this, so this is one possible solution. Your exact requirements may vary, but this is the basic form of such a trigger.
please this code
in trigger
string name = [select name from profile where id = :userinfo.getProfileId()].name;
if(name == 'System Administrator)
//perform ur logic