Uanble to hide the Mandatory fields unless made Non-Mandatory before hiding

Rizwan Shaikh
Mega Guru

Hi,

We are upgrading our instance to London version. We are facing an issue within Catalog Items.

Within the new version we are unable to hide a field in Catalog Client Script or Widget which is mandatory.

In order to hide we need to make it non-mandatory before hiding.

I want to know how we can turn off this behavior? i believe there might be some property or anything through which we can turn it off.

Please let me know how we can achieve this.

6 REPLIES 6

Shubham Kakade
Giga Guru

Hello Rizwan,

 

Check if there is any Data Policy or UI policies applicable.

Thank you

SatheeshKumar
Kilo Sage
I think it can't be deactivated using property. It was a change in behaviour of the methods and not configurable. -satheesh

Ritanjali Pati
Mega Expert

Hi Rizwan,

 

Please check if any ui policy has been written for that mandatory field and set it non-mandatory and try this code in your onLoad catalog client script:

 

function onLoad()

{
g_form.setDisplay('field name', false);

}

 

Let me know if any issue is there.

 

Please mark my answer correct if you found it helpful/correct

 

Thanks,

Ritanjali

www.dxsherpa.com

 

Shweta KHAJAPUR
Tera Guru

In catalog items always Mandatory will run first. You can not hide mandatory field in catalog item. Always mandatory takes precedence over visibility specially in catalog items.

 

The priority order for UI actions types is:

  1. Mandatory (highest)
  2. ReadOnly/Display

If a variable is set to mandatory and does not have value, readonly or hide do not work on that variable. If a variable is hidden or readonly, and then set to mandatory, the variable field becomes visible or editable.

This priority order is also applicable for variable sets and containers. If a variable set or container has a mandatory variable without any value, then the container or variable set cannot be hidden.

 

Pleease refer this doc,

https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-managem...