Catalog Client Script - OnChange - Remove Mandatory Field if Assignment Group Changes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 11:29 AM
Trying to use a Catalog Client Script - OnChange
When Catalog Task is Created will want variable set to mandatory
If Task Assignment Group is Changed, want to remove the variable mandatory.
UI Type - ALL
Applies on Catalog Tasks is Checked
Been trying to use this script, but not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2024 11:48 AM
So "should_this_go_to_the_committee_to_assign_more_groups" is a variable and it's mandatory by default?
Is the mandatory set on variable record or by a client script or a UI policy?
There's a certain run order on things.
Client scripts -> UI policies -> Variable record values.
So if you have a client script that says "setMandatory('field', true)" and a UI policy that sets it false, the UI policy overwrites the client script.
If you have "mandatory" or "read only" field set true on the variable the client scripts and ui policies won't overwrite it. You'd have to set the field to false and then create a client script or UI policy to handle setting it to true normally.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 07:25 AM
Thank You Mega,
It turned out it was the type of Client Script I was using - Catalog Client Script vs Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 08:00 AM
Hi @Mark Lanning, Catalog task field (Ex- State) values can be accessed using the Client Scripts where as the catalog variables (Ex- should_this_go_to_the_committee_to_assign_more_groups) are accessed in the Catalo Client Scripts. As per my knowledge, it is not feasible to manage the varaibles (like making variable mandatory) based on the state of catalog task.
Regards,
Sunil