Make a field ReadOnly with Business Rule.

prabh
Mega Expert

Hi All,

 

How can I Make a field ReadOnly with Business Rule.

 

Thanks !!

 

Regards,

Preety.

1 ACCEPTED SOLUTION

Hi Preety,



This is definitely the place to use an ACL. There is a good outline of ACLs on the wiki here Using Access Control Rules - ServiceNow Wiki



To add an ACL for what you describe you would create a write rule for the Incident.Work_notes field for the when the status is not closed and status is not resolved. Then add the ITIL role to the ACL.



This will allow access to the field when the conditions are true and block access when they are false. If you select the "Admin overrides" check box then Admins will be able to write to the field even if the conditions are false.



Cheers,


Cameron


View solution in original post

8 REPLIES 8

Hi All,



Thanks all for your response. Its really helpful !!



I have modified a write rule for the Incident.Work_notes field with condition "status is not resolved". and have added the ITIL role to the ACL.Its working fine for ITIL role




But to add on to this requirement if I also want to make the worknotes editable for "ServiceDesk (contains role ITIL)" role when the status is resolved.




Thanks !!


Hi Preety,



If ServiceDesk is another role you can simply add another ACL with the ServiceDesk role attached. Then set the conditions with the new role to allow that role access to write to the worknotes. The system will allow access if it finds an ACL that gives access and deny access if there is no ACL that gives access as per the diagram below.



Acl_workflow.png



An easy option is to copy the existing rule you created with the "insert with roles" option in the right click menu and adjust as needed.



Hope this helps


Cameron


Hi Cameron,



I created a new ACL write rule with condition "status is resolved" and role "ServiceDesk". But if I made this rule active then no ACL rule is being executed . Not even first one that I Created earlier. Beacuse of which worknotes are being editable in every case and for every role



Please advice. Are these being contradictory to each other thats why rule is not being executed or there is something else I am missing out ??


I use the script in ACL write rule which will return "answer=true" depending on the incident state and user's role.



Thanks to all for help