Catalog task variable section field should be read only

Rahul84
Tera Contributor

Hi @Ankur Bawiskar /Team

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. 

 

2 REPLIES 2

Michael Jones -
Giga Sage

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!

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so any script must be clearing the variable value on sc task form

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader