If condition in A GRAPH

Hi Agata,

I am trying to achieve some thing like this :


if (“035”.equals(${in.0.EMP_TYPE_CD})
|| “075”.equals(${in.0.EMP_TYPE_CD}) )
{
${out.0.ORDER_CD} = “Y” ;
}
else {
${out.0.ORDER_CD} = “N” ;
}

com.clover.xforms.ReformatSetDefaults

I am getting an error which says it cannot compile this code. Is there any mistake in the way I am writing this code?

Hi,
mapping must be the last statement in your code, so you have to create function for getting value:

function accept(input){
if (input.eqauls."035" || input.equals."075") return "Y";
else return "N";
}

and then assign it to output field:

${out.0.ORDER_CD}:=accept(${in.0.EMP_TYPE_CD});