- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:08 AM
Hello All ,
I have an item with 2 tasks and i want to make editable the vatiable in the Task 1 and in read only in the task 2 ... How is the best way to do this ?
Thank you for your support
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:12 AM
you can use onLoad normal client script on sc_task and not catalog client script
Check the task description and see if it's 1st or 2nd and then make the variable editable
function onLoad() {
var shortDesc = g_form.getValue('short_description');
if (shortDesc == 'task 1 short description') {
g_form.setReadonly('variables.variableName', false);
} else {
g_form.setReadonly('variables.variableName', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:24 AM
yes catalog task sc_task since you mentioned catalog item
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:12 AM
you can use onLoad normal client script on sc_task and not catalog client script
Check the task description and see if it's 1st or 2nd and then make the variable editable
function onLoad() {
var shortDesc = g_form.getValue('short_description');
if (shortDesc == 'task 1 short description') {
g_form.setReadonly('variables.variableName', false);
} else {
g_form.setReadonly('variables.variableName', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:19 AM
When you talk about sc_task , you mean a DYnamic activity ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 06:24 AM
yes catalog task sc_task since you mentioned catalog item
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 08:17 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader