- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 03:44 AM
Hello,
we need to make the knowledge article body read-only as soon as the state changes to published and we are using the Global "Publish" UI action and do i need to write ui action to achieve this requirement, if so can you please share me the code.
Regards,
Bhavna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 07:45 AM
Hello Bhavana,
What's Difficult in it?
1.Simply create a UI Policy and add condition when Workflow IS Published.
2. With the help of UI Policy Action, Make Read Only TRUE For Article body:
NOTE: Though field is not grayed out but its non editable/read only.
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 07:44 AM
If you enable the "Knowledge Management Advanced" plugin in ServiceNow, versioning will be enabled and when an article is published, it will become read only until checked out. If you can't do that, would a UI Policy work for making the article read only, rather than a UI Action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 07:45 AM
Hello Bhavana,
What's Difficult in it?
1.Simply create a UI Policy and add condition when Workflow IS Published.
2. With the help of UI Policy Action, Make Read Only TRUE For Article body:
NOTE: Though field is not grayed out but its non editable/read only.
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2019 11:57 PM
1.You need use Either UI policy of Client client in order to achieve your requirement. Its recommended to stay with Out of the box functionality.
2. You can try creating a Client side UI action by clicking Client checkbox true and add folllowing code:
function makeReadOnly(){
alert("ui action called");
if('Add condition '){
g_form.setReadOnly('u_net',true);
}
}
but you need to use UI policy or onLoad Client client at the end
Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2019 12:25 AM
I personally would not recommend using UI Policy in this scenario.
Your requirement is to enforce security - that is what ACL's are for.
I'd strongly recommend checking out the Knowledge Management Advanced plugin as Weston has mentioned.
Not only will this address your requirement, but you'll also get a whole lot of great additional features such as Knowledge Versioning and Knowledge Blocks.
If you aren't in a position to adopt this plugin, use ACL's to lock down your KB articles that are in a published stage to meet this requirement. If you use UI Policy, a user can always just re-enable the field using any modern browser to make changes.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022