Making a tab mandatory

Shir Sharvit
Tera Contributor

hey


I want a certain condition when a field in the incident form is equal to the value 5

A section will become mandatory and the fields it contains will also become mandatory.

 

thanks, Shir

18 REPLIES 18

okay.
Try with the following client script:

Type : on change
Field name : Unit(u_unit)
Script :

if ((g_form.getValue('u_unit') == '6');

{

g_tabs2Sections.markMandatoryTabs();

}
Considering you had written UI policies for same condition to mark field mandatory.
so keep order of client script bit higher than UI policy.

Thanks,
Rohit Suryawanshi

Where exactly do I write the name of the section in the line of code?

Can you please share screenshots of your code/UI policies.

Hi @Shir Sharvit 

 

Did you got a chance to look on the below posts :

https://www.servicenow.com/community/developer-forum/mandatory-fields-on-a-tab/m-p/1474047

 

Alternatively, you can look into the below link to understand more about g_tabs2Sections.markMandatoryTabs() :

https://www.servicenow.com/community/developer-blog/demystifying-form-tabs/ba-p/2287086

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.