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

Hi,

any other business rule is executing after your BR which is making it false again?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

No Business rule i can see in system on made_sla field. Only mine is there.

 

Thanks,

Aahita

Hi,

did you try setting some other field withing the if logic

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Where is this script running? Business Rule? When? Can you provide some more details on this.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi Mark,

 

Script is running in busineess rule.

When: Before Business rule

Action: Insert/Update
Condition: Widow start is not empty

 

Thanks,

Aahita