- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 03:39 PM
Hello All,
I would like to know if there is a way to restrict checklist items in the record form being updated or modified after record moved to closure state.
Regards,
GB
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2017 07:16 AM
Hi,
after trying with ACL and Client scripts, I found a very simple way.
You have to modify the UI Macro inline_checklist_macro. I added a condition linked to the state of the containing task
inline_checklist_macro
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate>
var isBrowserSupported = (GlideVTBCompatibility.getCompatibility() != 'block');
var isNewUI = gs.getProperty('glide.ui.doctype', 'false') == 'true';
var isNewRecord = true;
if (isBrowserSupported $[AMP]$[AMP] isNewUI) {
var sysID = current.getUniqueValue();
var tableName = current.getTableName();
isNewRecord = current.isNewRecord();
// get the checklist ID for this record
var checklistID = null;
var checklist = new GlideRecord("checklist");
checklist.addQuery("document", sysID);
checklist.addQuery("table", tableName);
checklist.query();
if (checklist.next())
checklistID = checklist.getUniqueValue();
if (current.state == -5 || current.state == 3 ) { // Pending or Closed
var readOnly = "true";
} else {
var readOnly = "false";
}
}
</g2:evaluate>
<body>
<j2:if test="$[!isNewRecord]">
<g:macro_invoke macro="checklist_template" readonly="$[readOnly]" record="$[sysID]"
table="$[tableName]" checklistid="$[checklistID]"/>
</j2:if>
</body>
</j:jelly>
Thanks.
PS: Hit like, Helpful, Correct, if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 03:42 PM
Create new UI policy with condition active = false or state = closed. and mark this field read only.
Thanks.
PS: Hit like, Helpful, Correct, if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2017 03:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 08:13 AM
Thanks!
Here checklist is not a field. it is additional functionality which can be enabled through plugin. So, There is some UI pages and UI macro inorder to get them displayed on the ticket form layout.
Regards,
GB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 08:31 AM
https://community.servicenow.com/message/689424#689424
Thanks.
PS: Hit like, Helpful, Correct, if it answers your question.