Catalog Client Script not working on RITM and TASKS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 10:23 AM
Hi guys, I'm having an script issue that doesn't make any sense in my head
I created an Catalog Client Script with the following conditions:
> When Requested For Region is different from south america:
The field "Request Type South America" is false and the field "Request Type" is mandatory and visible
> else >
The field "Request Type South America" is true and mandatory, and "Request Type" is false and not visible
It is supposed to work this way on tasks and ritm too
It is working fine for South America
Request Type South America is mandatory and visible on RITM and TASK
But Request Type (not SA) is only mandatory and visible on catalog item, it disappears on RITM and TASK
I tried to reverse the conditions, looked through everything I might be doing wrong, even chat GPT told me the script is ok
I don't know what is causing this behavior
Could you please help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 11:12 AM - edited 09-03-2024 11:15 AM
Whenever using setMandatory in a client script, you must make the field or variable not mandatory before attempting to hide it. Also make sure you do not have any other Catalog Client Scripts or Catalog UI Policies that could be affecting these variables. As a preference, you may want to use setDisplay in place of setVisible as when hiding variables, the empty space will be consumed by visible variables when using setDisplay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 12:24 PM
Hi @beatricelopes , you need to set the field as non-mandatory before hiding the field. Please reorder the code to get the desired functionality.