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 03:28 AM
Using current.update() in a before business rule is considered bad practice.
Kind regards,
Mark
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 03:55 AM
Hello,
AFTER business rule with current.update() also not working.
BEFORE business rule -> i am not using current.update BCZ its not best practice.
Same BEFORE business rule is working in DEV environment, this issue is in UAT environment.
Thanks,
Aahita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2021 04:08 AM
Any luck with what I mentioned on trying with setWorkflow(false)?
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
