how to make field mandatory based on the view

SV17
Tera Contributor

how to make field mandatory per the manager view.

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can make a client script to run only on Manager view and make the field mandatory

Uncheck the global checkbox so the view box will come up.

 

find_real_file.png

 

-Anurag

-Anurag

Allen Andreas
Administrator
Administrator

The above by Anurag will be great to use if you only want this client script to run for that particular view.

If you have other logic that's already happening and written in a client script, etc. AND you want one piece of it to execute for a particular view, then you can use:

g_form.getViewName()

So, say you had a bunch of script already in set for other reasons and then you wanted to have one part of it run per the manager view name, you'd can use:

//do other code here
//line 1
//line 2
//line 3
if (g_form.getViewName() == 'manager') {
g_form.setMandatory('field_name', true);
}

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!