Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Workspace UI Action always reopens same Record Producer — how to force new form?

Niharika20
Tera Expert

Hi All,

I’m working in Dispatcher Workspace and I have a UI Action on the sys_user table that should open a Record Producer (Catalog Item) to create an Event.

Here’s the problem I’m facing:

  • When I click the UI Action from a user record for the first time, it works fine and opens the Record Producer form.

  • But when I later go to a different user record and click the same UI Action, it reopens the previous Record Producer session (with the old data) instead of loading a fresh form for the new user.

  • Even after submitting the producer form, the Workspace redirects me to the view details page of the old submission. If I click the UI Action again from a different user, I still end up in that same old form instead of a new one.

Here’s the UI Action code I’m currently using:

function onClick(g_form) {
    var recordProducerID = g_scratchpad.PRODUCER_ID_CREATE_EVENT;

    var params = {};
    params.sysparm_parent_table = g_form.getTableName();
    params.sysparm_parent_sys_id = g_form.getUniqueValue();

    localStorage.setItem('TEST_user', g_form.getUniqueValue());
    g_service_catalog.openCatalogItem('sc_cat_item', recordProducerID,  '-1', params); // I also tried g_aw.OpenRecord(); same issue }

I also tried other approaches such as using g_navigation.open() or window.open(), but in Workspace they don’t seem to work.

My Question:
How can I ensure that every time a user clicks this UI Action, it opens a new Record Producer form instance in Workspace (instead of reusing the old one)?

Has anyone else run into this issue in Workspace with Record Producers? Is there a recommended way to force a fresh form each time?

Thanks in advance!

5 REPLIES 5

Joshua Chen MTL
Mega Sage

is there a reason why you want this on the dispatcher workspace, when you should be using csm/fsm workspace > workforce or manager workspace? these are the 2 main places where the fsm personas create events 

.
Add me on LinkedIn 🙂 https://www.linkedin.com/in/joshuachen0510/