I’ve written some basic JS to set the value of a field if the conditions have been met but I’m finding that the first two lines work i.e. the value sets as I expect but condition 3 and 4 default to conditions 1 and 2 respectively.
So, if all the conditions of the first line are met then the field ‘le_queue’ is set to Office 1 – Cash but if all the conditions of line 3 are met then then value of the ‘le_queue’ is not set to Office 1 – Client Cash but instead set to the value stated in line 1
if ('sel_paybasis',label === 'Section 12'&&'sel_paymethod',label === 'Cash'&&'sel_payoffice',label === 'Office 1')
{
KDF.setVal('le_queue','Office 1 - Cash');
}
else if ('sel_paybasis',label === 'Section 17a'&&'sel_paymethod',label === 'Cash'&&'sel_payoffice',label === 'Office 2')
{
KDF.setVal('le_queue','Office 2 - Cash');
}
else if ('sel_paybasis',label === 'Corporate Appointee'&&'sel_paymethod',label === 'Cash'&&'sel_payoffice',label === 'Office 1)
{
KDF.setVal('le_queue','Office 1 - Client Cash');
}
else if ('sel_paybasis',label === 'Corporate Appointee'&&'sel_paymethod',label === 'Cash'&&'sel_payoffice',label === 'Office 2')
{
KDF.setVal('le_queue','Office 2 - Client Cash');
}
else
KDF.setVal('le_queue','');