Field keeps mandatory even if set to false

Clement Dos San
Tera Contributor

Hello,

I hide/show fields on a catalog item, but I have an issue with somes when set them to non mandatory.
By Default, they are non mandatory.

Catalog Item _ ServiceNow De.png

 

When Decomission is selected , I hide all the fields and set those one to non mandatory

decommision.png

 

At the opposite, when Comission is selected , I show the fields and set them to non mandatory.

Commission.png

But the fields remains mandatory when the form is loaded.
Note that the behavior is the same when fields are mandatory = false
Issue.png

I am the creator ot he catalog item so I can say there is no other place where the fiields are configured, even in a script.
The name of the fields are enough particular so I pretty sure they are not used of the catalog and configured inadvertently
Thank you for the help.

 

8 REPLIES 8

Can you try onload client script making the variables mandatory false.

Hello, I have already a catalog ui Policie which make the fields mandatory on loading.
But I still tried the catalog client script on loading but it does not work

2023-09-18 10_31_19-Mandatory _ Catalog Client Scripts _ ServiceNow Development - IT Service Managem.png

 

Thank you

Hello Clement, 

you don't need to have a client script for this.

You only need to have 1 ui policy for what you are trying to achieve.

Take your first ui policy where type_of_request is Decommission and click "Reverse if false".

 

If you want your variables to be mandatory when type_of_request is Commission, set Mandatory to False on all you variables in the ui policy actions

 

Hope it helps

Simon

Hi @SimonD 

I can't use this feature given how my cat item is made.
I manage myself field's properties with Catalog Ui Policies and using the "reverse if false" feature will break that.

Thank you