- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 02:46 AM
Hi Everyone,
I am trying to set a field value to current date and time through script include, code as below
this is the after BR
I am getting log message as this an empty space
can anyone please let me know if there's anything wrong over here.
Thanks and Regards,
Abhi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 03:21 AM
Hi Tom,
Thanks for the suggestion, I made a mistake in script include
This is working fine now

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 03:01 AM
Hi Abhi,
I think the problem is that you're trying to do current.sys_class_name and current.sys_id which I don't think will work in a script include. Maybe try passing the sys_id and the sys_class_name as params into your function? As an addition, you don't need to add a query or do gr.query() after a get - get fetches the record directly.
Having said that, I'm not sure what the script include is achieving that can't be completed using a standard business rule and personally I've got some doubts about using an after business rule to update the same record that's just been submitted. It seems like double processing and double submitting.
Personally I'd suggest considering a before business rule which runs this:
var time = gs.nowDateTime();
current.u_branch_down_end = time;
Unless I've missed something and you're actually trying to update something somewhere else?
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 03:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2022 03:24 AM
Oh cool! Glad it's working. Good to know that you can access the current object in script includes, today I learned! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2022 07:44 AM
Hi Abhi,
Could you share the script of the script include that you are using to update the date and time? I have the same requirement.
Thanks.