Custom Validation Script To Set Drop-down Items
I am trying to use a custom validation script (or a custom keystroke script - whatever is best) in a drop-down to set the items in another drop-down based on the display value (not the export value). If I use the export value, it works without issue. If I use the display value, it is always one step behind the selection. I am using the following validation script in Dropdown1:
if(event.target.getItemAt(event.target.currentValueIndices, false)=="A")
{
this.getField("Dropdown2").setItems(["aa","aaa"])
}
if(event.target.getItemAt(event.target.currentValueIndices, false)=="B")
{
this.getField("Dropdown2").setItems(["bb","bbb"])
}
When I select "A" in dropdown one, it sets the items as if I selected "B" and vice versa.

