TRUE/FALSE field is not working

aahitha2
Mega Expert

Hi Team,

I have a true/false field(made_sla), this field need to populate as true or false based on two date&time fields(X&Y).

if(X>Y) then made_sla=TRUE

else if(X<Y) then made_sla=FALSE.

 

logic is working and logs also printing, but made_sla is always showing as "FALSE" we do not have default value defined for this field.

if (widnowstart > breachtime) {
current.made_sla = 'true';
//gs.addInfoMessage("made:" + current.made_sla);
} else if (widnowstart < breachtime) {
current.made_sla = 'false';

}

Addinfo mesages are coming correctly but field is not updating, i have tried business rule on Before and after.

What might be the reason why Made_sla not accepting TRUE value? can anyone help me what are the backend logic stoping except dictionary default value.

 

 

Thanks!

 

 

17 REPLIES 17

Erik Gardner1
Giga Guru

Hi aahitha,

If made_sla is a boolean then remove the quotation marks when setting the values.

Like this:

if (widnowstart > breachtime) {
current.made_sla = true;
//gs.addInfoMessage("made:" + current.made_sla);
} else if (widnowstart < breachtime) {
current.made_sla = false;

}

 

Kind Regards,

/Erik

Hi Erik,

I have tried with your modifications but still issue same. I am checking in record XML made_sla is defaulty showing False, if logic is printing True also.

find_real_file.png

 

ok, its hard tell without the full details but if the BR is After then you will also need to run current.update() after setting the values in order to save again.

I have tried After Business rule with current.update(), still same issue.