Business Rule - Async on insert Gliderecord on related table sometimes returns undefined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2023 05:31 AM
Hi all,
I am running into an issue with a business rule that runs async insert.
When I run the business rule, it triggers a script include that does a glide record to items in the related list of that record. I have noticed that I sometimes get a return that it doesn't find an item in this related list.
Sometimes it works fine, but I need to get the data from that related list reliable.
Is there a way I could either delay the business rule by a short time (1 second is already plenty, since that is the delay sometimes between the 2).
Thanks in advance,
Jonas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2023 05:48 AM
@Jonas VK wrote:Hi all,
I am running into an issue with a business rule that runs async insert.
When I run the business rule, it triggers a script include that does a glide record to items in the related list of that record. I have noticed that I sometimes get a return that it doesn't find an item in this related list.
Sometimes it works fine, but I need to get the data from that related list reliable.
Is there a way I could either delay the business rule by a short time (1 second is already plenty, since that is the delay sometimes between the 2).
Thanks in advance,
Jonas
If your BR is running on insert ,then relation to other table(related list target table) may not already be made,so try wait function in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2023 05:56 AM
gs.sleep(1000); //duration in ms, this is 1 second
works in the global scope, but depending on what your planned outcome actually is, there might be a better way to go about this, e.g. perhaps having the BR on the table of the related items with different conditions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2023 05:59 AM
This BR is in a scoped application, so this might not work.
Unfortunately, I have to trigger from here due to other data that gets handled on here related to this.
Regards,
Jonas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2023 08:11 AM
You can create a global SI with the sleep function in it which could be called from other scopes, as described in this support article.