how to make field mandatory based on the view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 09:27 AM
how to make field mandatory per the manager view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 09:35 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2022 09:44 AM
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!