- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 04:58 AM
Hi Team,
We have created one form and it contain 10 variables. 5 variables are filled at the time of creating the request. Once it is approved by the line manager it will create the catalog task1, in this task group owner need to fill the 3 variables. In this task 5 variables are read only. Once this task it is closed it will create other task2 requesting the group owner to fill other 2 variable. In this task2 previously filled 3 variables should be in read only. once task2 is closed it will create task 3 and all the variables should be in readonly. Please help me how to achieve this.
Solved! Go to Solution.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2020 09:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 05:25 AM
Hi Arun
you have to write the client script or ui policy only , for making field read only. you can not make field read only on workflow activity.
refer the following thread might help you.
If it help mark helpful or correct.
Thanks and regards
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 05:42 AM
Hi Arun,
you can have single catalog client script onLoad which applies on Catalog Task
UI Type - All
in the script determine which task it is based on short description and accordingly make those variables as editable or readonly
I assume each Catalog task has unique Short Description
function onLoad(){
var shortDescription = g_form.getValue('short_description');
if(shortDescription == 'Catalog Task 1 Short Description'){
g_form.setReadOnly('variable1', true);
g_form.setReadOnly('variable2', true);
}
if(shortDescription == 'Catalog Task 2 Short Description'){
g_form.setReadOnly('variable3', true);
g_form.setReadOnly('variable4', true);
}
if(shortDescription == 'Catalog Task 3 Short Description'){
g_form.setReadOnly('variable4', true);
g_form.setReadOnly('variable5', 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
09-02-2020 06:26 AM
Hi Ankur,
It is not working as expected. I even tried with other field as well. But also it not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 08:18 AM
Hi Arun,
Please share which field will be unique on sc_task
Also please share your script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader