How to make the field non-mandatory

Kaushik Ghosh
Tera Contributor

In a form there are few tab, one tab is mandatory, as per requirement I have to make a dropdown field mandatory in that tab, could you please let me know there any way to make the dropdown field non-mandatory. 

There are two approaches I am thinking,
1. Make the dropdown field non-mandatory

or

2. Remove the particular field from the mandatory list.

I need the solution could you please help me to fix the issue.
Please find the attached screenshot for your reference.

The form name is std_change_proposal and the the field that I need to make non-mandatory is u_funding_id. This comes under change request value which is Mandatory as a whole.

7 REPLIES 7

Martin Ivanov
Giga Sage
Giga Sage

you can write an onLoad client script. Select a name of your choice, specify the table (change_request)

in the script type:

g_form.setMandatory('u_funding_id', false);

Please mark Correct and Helpful if my answer helps you resolve your issue. Thanks!
Martin Ivanov
Community Rising Star 2022


Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024

Hi Martin,

I have already made the change_request.form and made the field non-mandatory, but the issue is the value comes form std_change_proposal.form, where the funding id field is mandatory. Kindly check the screenshot from the attachment. As per the existing form design the option comes in a dropdown option under a tab. The tab itself is mandatory and it is control by a script. 

Could you please let me know is it possible to make non mandatory using ui policy or client script. If yes how or is there any other way to do it.

 

Check my update

Hello,

Not sure if I understood correctly but if you don't want to keep field mandatory while creating standard change template then go to Standard change properties and remove fields whatever you don't want to make it mandatory.

https://instance/std_change_properties.do?sys_id=527b5dafff700200b18affffffffff89

find_real_file.png

Please hit like and mark my response as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Yousaf
Giga Sage

Hi Kaushik,

Yes you can try that to make whatever making it mandatory false.
Also you can write client script 

Make sure to check first whats making it mandatory because acl takes precedence over client script check this link it has a very good answer to understand precedence.

order of precedence over a field

 

Mark Correct or Helpful if it helps.


***Mark Correct or Helpful if it helps.***