I want to be able to display a workflow in a Workspace.

Alessa
Mega Guru

Hello dear community I need help:

I need in the workspace to be able to display the workflow (just like in a request within the Service Now platform).

Ej: We select this on the platform:

find_real_file.png

To display the workflow:

find_real_file.png

In order to do this in the workspace I did the following:

I selected: Workspace form button and Format for configurable workspace

find_real_file.png

The button appears in the workspace, but nothing happens when you click it:

find_real_file.png

 

I need to select the "Show workflow" button to display the workflow. Can someone help me to solve this?

Thanks in advance

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

hello @Alessa ,

try putting this script in workspace client script

function onClick(g_form) {
// Show the workflow context in a new window

    var url = new GlideURL('/context_workflow.do');
    url.addParam('sysparm_stack', 'no');
    url.addParam('sysparm_table', 'sc_req_item');
	url.addParam('sysparm_document', g_form.getUniqueValue());
	g_navigation.open(url.getURL(), "_blank");

}

Hope this helps 

please mark my answer correct if this helps you

View solution in original post

12 REPLIES 12

hello @Alessa instead of g_navigation.open just use Open

open(url.geturl(),"_blank");

It doesn´t work 😞

 

find_real_file.png

@Alessa can you try putting alert of url.getURL()

alert(url.getURL());

lets check if its going inside the script once you click on the button

Nothing happend, the button doesn´t work 😞

find_real_file.png

@Alessa NO THE WAY YOU PUT THE ALERT IS INCORRECT YOU NEED TO PUT LIKE THIS 

function onClick(g_form) {
// Show the workflow context in a new window

    var url = new GlideURL('/context_workflow.do');
    url.addParam('sysparm_stack', 'no');
    url.addParam('sysparm_table', 'sc_req_item');
	url.addParam('sysparm_document', g_form.getUniqueValue());
alert(url.getURL());
	open(url.getURL(), "_blank");

}