Set all fields read only when state is completed

Anil74
Tera Guru

Hi All,

I wrote a UI  policy to make all fields read-only when the problem state is completed. But while changing the state only all fields are getting read-only. As per the requirement after saving the form fields should become read-only. Please help me with this.

Thanks in advance.

1 ACCEPTED SOLUTION

Nootan
ServiceNow Employee
ServiceNow Employee

Hi Anil,

You can use this condition for problem_task

find_real_file.png

Thanks

View solution in original post

12 REPLIES 12

prasannaposetty
Tera Expert

Hi Anil,

You need to create a Write ACL on the table and give the condition "State is Completed" and roles "Nobody".

Please mark Correct/Helpful if this answers your question. 

 

Thanks,

Prasanna Posetty

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Anil,

Any update on this?
Can you mark answer as correct, 👍 helpful if you were able to achieve the requirement. This enables other members to learn from this thread.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Instead of using UI Policy, have a look at these 2 out-of-the-box ACL's:

find_real_file.png

One is for the ITIL role, the other for sn_problem_write role. They both contain below code:

answer = true;
if (pm.isActive('com.snc.best_practice.problem.madrid.state_model')) {
	if (current.state == ProblemState.STATES.CLOSED)
		answer = false;
}

So if you have the plugin mentioned activated, then already the records should get read-only / no write access when a closed state is reached.

If you do not have the plugin mentioned activated, you have to edit these ACL's. You could already do this with the available condition builder. Simply adding state | is not one off | your closed states, or active | = | true.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn