TRUE/FALSE field is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 01:14 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 01:49 AM
Hi,
any other business rule is executing after your BR which is making it false again?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 01:51 AM
No Business rule i can see in system on made_sla field. Only mine is there.
Thanks,
Aahita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 02:33 AM
Hi,
did you try setting some other field withing the if logic
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 01:21 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 01:32 AM
Hi Mark,
Script is running in busineess rule.
When: Before Business rule
Action: Insert/Update
Condition: Widow start is not empty
Thanks,
Aahita