Before Update BR not working as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Community,
I’m facing an issue with a custom Business Rule on the Requested Item (RITM) table and would appreciate your guidance.
I have a Before Update Business Rule that executes when the RITM state changes to Fulfilled. The purpose of this rule is to populate a custom Date/Time field using gs.nowDateTime();
The Business Rule works as expected for most RITMs. However, for a few RITMs, even though the state successfully changes to Fulfilled, the custom Date/Time field remains empty.
I added gs.info(); statements within the Business Rule for debugging. However, no log entries are being generated for the affected RITMs, even though the state change to Fulfilled is completed successfully.
Has anyone experienced similar behavior with RITM fulfillment? Could this be related to fulfillment workflows/flows, execution order, or multiple updates during state transition?
Any suggestions or best practices to ensure the field is populated would be greatly appreciated.
Thank you in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you didn't share the BR config screenshots etc
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello All,
Thanks for responses,
Here is the configuration set up -
When to Run - Before Update
Condition - State Changes to Fufilled
Script - current.field = gs.nowDateTime();
Changing Order wasn't helpful either, Fulfillment is through workflow/flow, yet data and time are set using BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
better to use GlideDateTime instead of gs.nowDateTime
current.setValue('field', new GlideDateTime());
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @MHimabindu
If you are using the nowDateTime() in the scoped applications it may not work as expected try to use
