Hello,

I get numeric value from the vault and I would like to show the
corresponding string in the form.

Instead of using if else multiple times, I try to use "switch" :

var sUser = form.getValue("target");
if (sUser)
{ var sContract = IDVault.get(null,sUser ,'user',
'MetaUserContractType');
switch (sContract) {
case "01": form.setValues("contracttype","Permanent Contract")
break;
case "02": form.setValues("contracttype","Temporary Contract")
break;
case "03": form.setValues("contracttype","Temporary assignement
(mission)")
break;
case "99": form.setValues("contracttype","Freelance")
break;
case "": form.setValues("contracttype","")
break;
}

Only the default value for empty attribute is returned, we tried case
01, '01' and "01"

Any idea ?

Thanks a lot.

Sylvain


--
sma
------------------------------------------------------------------------
sma's Profile: https://forums.netiq.com/member.php?userid=174
View this thread: https://forums.netiq.com/showthread.php?t=46563