OnChange client script is not working in RITM level?

Shantharao
Kilo Sage

Hello All,,

City is select box varibale, it contains below  two choices 

ABC

DEF

State is another select box it contains below choices

abc1

abc2

abc3

abc4

 

In the city variable on selection of ABC, I want to keep abc1 & abc2  and want to remove abc3 & abc4, This scenario is working on catalog form but not working on RITM level, but I have ticked/checked both catalog Item view and requested item view check boxes for this onchange client script

 

var loc = g_form.getValue("location_required_requisition");

if(loc == "ABC"){
g_form.removeOption("state","abc1");
g_form.removeOption("state","abc2");
}
else{
g_form.addOption("state","abc1","ABC1");
g_form.addOption("state","abc2","ABC2");

g_form.addOption("state","abc3","ABC3");
g_form.addOption("state","abc4","ABC4");
}

7 REPLIES 7

Allen Andreas
Administrator
Administrator

Hi,

Can you please show your script you're using and screenshot of the settings, if possible.

Thanks!


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

var loc = g_form.getValue("location_required_requisition");

if(loc == "ABC"){
g_form.removeOption("state","abc1");
g_form.removeOption("state","abc2");
}
else{
g_form.addOption("state","abc1","ABC1");
g_form.addOption("state","abc2","ABC2");

g_form.addOption("state","abc3","ABC3");
g_form.addOption("state","abc4","ABC4");
}

Actually...I was working on something yesterday and I used a UI Policy (I'm on Kingston Patch 14) and I was actually doing some adding and removing of options as well and sure enough on catalog item it worked....went to the RITM and Task and it wasn't working, all select-box options were showing.

For me...I'm just gonna leave it as is because that team wouldn't need to change that field and if they did...the whole thing should be going to another team anyway which means the workflow would need to be changed and not them addressing it on their level...so I'm fine.

However...I can see where this can be annoying.

My only suggestion at this point without further testing...is to create another client script on the RITM itself and see if it takes effect.

What version of SN are you on?

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


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

Elijah Aromola
Mega Sage

Do you have another script overriding this on the RITM? Can you post your onchange script.