How to submit a record producer in Workspace?

Howard9
Tera Contributor

Currently, I have a record producer that redirects to a task record when I submit it within the old UI. I'd like the same behavior to happen within the Agent Workspace, like in the below scenario:

 

While viewing an Incident record in Agent Workspace, I'd like my users to be able to click a UI Action to open a separate Workspace tab that points to a Record Producer. Once they submit the Record Producer, I'd like to redirect them to the record I created within the Record Producer script (I used producer.redirect in the Record Producer script).

 

Is this possible? If not, are any parts of this possible?

 

if(current.update()){
	action.setRedirectURL("com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=b7fb4609db91e4505775e05e1396193d");
}

So far, using action.setRedirectURL within the UI Action script hasn't worked. I tried the script above, but nothing happened besides refreshing the current Workspace tab.

If you can offer any guidance, it'd be much appreciated. Thanks!

 

1 ACCEPTED SOLUTION

Howard9
Tera Contributor

The answer is that it cannot be done.

Whenever you open up a Record Producer or Catalog Item within the Agent Workspace in a new tab, the Tab contains a Service Portal view of the Record Producer. It seems that it cannot communicate with Agent Workspace, so any redirects you do will take you to a Native or Service Portal view -- not the Agent Workspace.

In other words, the Agent Workspace tab will end up containing a Native view of a record -- which looks really bad to your users.

So if you need a record producer in the Agent Workspace, think about whether you need to redirect the user after it is submitted. If you don't, then it's fine -- the agent can just close the tab. If you do need a redirect, don't use a record producer.

I ended up customizing the logic on the [sc_task] form so that the agent never left the Agent Workspace when submitting the form. This made all the redirects easy.

View solution in original post

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Howard9
Tera Contributor

The answer is that it cannot be done.

Whenever you open up a Record Producer or Catalog Item within the Agent Workspace in a new tab, the Tab contains a Service Portal view of the Record Producer. It seems that it cannot communicate with Agent Workspace, so any redirects you do will take you to a Native or Service Portal view -- not the Agent Workspace.

In other words, the Agent Workspace tab will end up containing a Native view of a record -- which looks really bad to your users.

So if you need a record producer in the Agent Workspace, think about whether you need to redirect the user after it is submitted. If you don't, then it's fine -- the agent can just close the tab. If you do need a redirect, don't use a record producer.

I ended up customizing the logic on the [sc_task] form so that the agent never left the Agent Workspace when submitting the form. This made all the redirects easy.

azar
Tera Contributor

Hi Howard,

I'm stuck with the same requirement. By clicking the Create Incident button on the Agent workspace, we need to load the RP and by clicking Submit, the incident should be created and attached to the Interaction record. 

Could you please help me with your customization script?