- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 05:42 PM
In my case I'm using two different tables . does g_scratchpad work for two different tables ?
case:
In incident table there is a field that reference problem table i.e. of name "problem_id" by using display BR and scratchpad i need to move that specific incident number to the respective problem table and set that to a newly created field named "u_incident_ref".
In system logs it was logging data perfectly but while trying to fetch from problem table client script it was showing as undefined
please refer below screenshots for better understanding!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 06:40 PM - edited 10-23-2024 06:41 PM
Any Business Rule is defined per table, and I am not 100% sure but g_scratchpad data is likely not shared between tables.
Also, a typical g_scratchpad use case is to pass data between server and client side of the same table, and not between tables.
You will likely need to:
1. Write a business rule (probably async) for the Incident table, that does a GlideRecord query of the problem with problem_id as the sys_id,
2. Update the u_incident_ref of the Problem record that came up as result of the query, with the sys_id of the current incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 05:48 PM
I beleive it will not work like that because the display BR will run when the incident form loads not when the problem form because the BR is in incident table not in the problem table.
Hope you understood
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 05:57 PM
ok but how can i actually solve this case ? is there any other alternative to do this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 06:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 06:40 PM - edited 10-23-2024 06:41 PM
Any Business Rule is defined per table, and I am not 100% sure but g_scratchpad data is likely not shared between tables.
Also, a typical g_scratchpad use case is to pass data between server and client side of the same table, and not between tables.
You will likely need to:
1. Write a business rule (probably async) for the Incident table, that does a GlideRecord query of the problem with problem_id as the sys_id,
2. Update the u_incident_ref of the Problem record that came up as result of the query, with the sys_id of the current incident.