- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 01:31 PM
I am aware it is best practice to not call current.update(); in any business rules. Can we use current.update(); in script includes?
I have an ajax business rule where I am sending over data to a script include. I want to update the current record. Can I do so in the script include? I know it works, however, I do not know if it is recommended.
Thank you in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 03:05 PM
Yes in that case.
We have similar integrations, where we run the integrations using script include and wait for the response and then do a current.update();
So you should definitely be able to use it.
The recommendation to not use BR on onBefore, is because the record is saved anyway. If you call an update on onBefore, it will go in to a loop. And if you run a update on onAfter BR, it will again run the same BR and run a update again.
But since your job will be calling a script include and then an integration which will be asynchronous, you are fine to use current.update(). Or you can query the table with sysid and update as well.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 02:03 PM
Could you please explain the use case? Most of the time, the fields values can be set, before the record is saved.
So setting values in a Before Business rule would save the data you want to save.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 02:10 PM
I am utilizing the ECC queue application to call custom code on our mid server. I need to wait for the response to come back from the mid server before updating the current record. The business rule is my trigger to call the script include. The script include has logic to initialize a new ECC queue record, and then wait for the response from the mid server. I want to use an ajax business rule, so my user does not have to wait for script include to finish processing.
Let me know if that helps, or if you need more information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 03:05 PM
Yes in that case.
We have similar integrations, where we run the integrations using script include and wait for the response and then do a current.update();
So you should definitely be able to use it.
The recommendation to not use BR on onBefore, is because the record is saved anyway. If you call an update on onBefore, it will go in to a loop. And if you run a update on onAfter BR, it will again run the same BR and run a update again.
But since your job will be calling a script include and then an integration which will be asynchronous, you are fine to use current.update(). Or you can query the table with sysid and update as well.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:05 PM
Hi Bill,
Not necessarily related to current.update()
But also a good read about the use of "current" in Script Includes 🙂