- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are opening a Record Producer from an agent record in the Configurable Workspace using a client-side UI Action.
The parent record sys_id of the agent is being passed and used in the on load client script in the record producer to prefill a variable (user) in it.
The issue is that when the record producer tab remains open, and we navigate to another agent and trigger the same action again, the previously populated sys_id is retained rather than being refreshed with the new record’s sys_id and the same tab is being opened.
We are currently using client-side parameter passing and local storage to transfer the sys_id.
Has anyone implemented a reliable way to pass parent record context to a catalog item in Configurable Workspace without stale data issues?
Or the problem is in how we are opening the Record producer?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Nirma Sai E @Ankur Bawiskar ,
Yeah, I tested it more after your message and you’re right, just using g_aw.openRecord() and reading the sys_id from the URL doesn’t fully fix it.
The real issue is that Workspace reuses the same Record Producer tab if it’s already open. So even though the URL changes, the component itself doesn’t reload, and the onLoad script only runs the first time. That’s why the old value stays.
So it’s not really a parameter passing issue , it’s how Workspace handles tab reuse.
What worked for me was not relying only on onLoad, but instead watching for URL changes and updating the field when the parent_sys_id changes. Since Workspace updates the route but keeps the component alive, we need to handle that manually.
Something like this, this script checks the URL every 500 milliseconds and updates the field only if the sys_id changes:
function onLoad() {
var lastSysId = '';
setInterval(function() {
var url = decodeURIComponent(top.location.href);
if (url.indexOf('extra-params/') > -1) {
var params = url.split('extra-params/')[1].split('/');
var currentSysId = params[1];
if (currentSysId && currentSysId !== lastSysId) {
lastSysId = currentSysId;
g_form.setValue('manager', currentSysId);
}
}
}, 500);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yeah, I thought the same at first.
But in this case, it’s really lightweight. It’s just checking the URL string in memory every 500ms, no server calls, no heavy processing. And since it only updates the field when the sys_id actually changes, it’s not constantly resetting the value.
So performance-wise, it hasn’t caused any issues in testing.
I agree it’s not the cleanest solution though. It’s more of a workaround because Workspace keeps reusing the same component and doesn’t fire onLoad again. If there was a proper event for route changes, that would definitely be better.
