- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 09:33 AM
Hello,
I ran into a roadblock with making a variable mandatory when another variable becomes true. I created a catalog client script but I believe my code is wrong. Has anyone run into this issue?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 11:45 AM
Change the type to Onchange and try with this
var m = g_form.getValue("concur").toString();
if (m.indexOf("true") > -1) {
g_form.setMandatory("approver_name", true);
} else {
g_form.setMandatory("approver_name", false);
}
Thanks,
Narsing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 09:38 AM
@Wyatt Fudal1 Instead of onLoad script, you need to write an onChange script on your Concur field and the field will become mandatory when checked.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:00 AM
@Sandeep Rajput Should I keep the same code?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:03 AM
@Wyatt Fudal1 Yes, the same code should be kept on onChange script as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 10:10 AM
The question is a part of separate Concur