How to make a question in a variable set mandatory when a separate variable value becomes true

Wyatt Fudal1
Tera Guru

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? 

Set approver.png

Not mandatory.png

variable and set.png

  

1 ACCEPTED SOLUTION

Narsing1
Mega Sage

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

 

View solution in original post

9 REPLIES 9

Sandeep Rajput
Tera Patron
Tera Patron

@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.

@Sandeep Rajput Should I keep the same code? 

@Wyatt Fudal1 Yes, the same code should be kept on onChange script as well.

The question is a part of separate Concur 

WyattFudal1_1-1705687631938.png

WyattFudal1_2-1705687776759.png