- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:37 PM
How to set the variables READ ONLY once the SCTASK is closed?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:50 PM
Hi,
create normal client script on sc_task table
Ensure you give correct catalog item sysId
function onLoad(){
var ritm = g_form.getReference('request_item', callBackMethod);
}
function callBackMethod(ritm){
if(ritm.cat_item == 'your catalog item sysId' && g_form.getValue('state') == '3'){
g_form.setVariablesReadOnly(true);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:43 PM
Hi,
You can follow link for the same. Just ensure you use the When To Apply conditions in UI Policy according to your Closed complete state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:50 PM
Hi,
create normal client script on sc_task table
Ensure you give correct catalog item sysId
function onLoad(){
var ritm = g_form.getReference('request_item', callBackMethod);
}
function callBackMethod(ritm){
if(ritm.cat_item == 'your catalog item sysId' && g_form.getValue('state') == '3'){
g_form.setVariablesReadOnly(true);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader