Hi All, Trying to control a combobox with a substr of a data field with no success so far.
I have populated the object with the "Choices" field with ",Part Time, Full Time"

and put this code in the datachanged delegate

function page1_section1_field6_datachanged()
{
// insert your code here
var emp = Lianja.getCursor("emp0_000");
var ddep = emp.getData("ddep");
var emptypidx = substr(ddep,4,1);
var Oitem = Lianja.getElementByID("page1.section1.field6");
switch(emptypidx){
case "F":
Oitem.value = "Full Time";
break;
case "P":
Oitem.value = "Part Time";
break;
case "T":
Oitem.value = "Temportary";
break;
default:
};
};

What am I doing wrong, it's getting into switch with the proper value?
TIA