Catalog task variable section field should be read only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2022 05:03 AM
Hi
I am facing an issue related to read only field.
I am having a field on a catalog item , which I have a set as read only in one of my catalog client script -onload.
I need to add the same field in my catalog task variable section as a read only. Via workflow I have added the field to variable section on task form.
For the same , I am making the "Applies on Catalog Tasks" checkbox to true on the catalog client script to make the field read only on catalog task variable section.
But the issue here is the field is coming empty on the catalog task variable section when I checked the "Applies on Catalog Tasks" , on the catalog form , the field is showing as read only.
Also when I uncheck the "applies on catalog task" checkbox , in this case the field on the catalog task form is coming up with the value correctly but in this case it is editable.
Pls see the attached ss.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2022 06:13 AM
So to be clear, you are using the same script to make the field read-only on the Catalog Form and it works, but checking the box for applies on catalog tasks results in the behavior you are describing?
It's interesting that the field is a reference field and has a value on the item but not on the task; I can't think of a reason that would occur unless the value is somehow being set via onload via script and your second script is somehow causing that to fail - just to confirm, have you checked the console for errors?
My first suggestion would be to try creating a UI Policy and UI Policy Action (read-only true, all others leave alone) for this field on your item with no condition and only check the box for applies on catalog tasks and see if you see the same behavior with your script unchecked.
I hope this helps!
If this was helpful, or correct, please be kind and mark the answer appropriately.
Michael Jones - Proud member of the GlideFast Consulting Team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2022 06:31 AM
Hi,
so any script must be clearing the variable value on sc task form
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader