[Show Workflow] UI Action for scoped application

amadosierra
Kilo Guru

This is a new thread created to properly separate this issue. Solution has been provided by Pradeep Sharma

Does anybody know how to implement the [Show Workflow] UI Action for an application?

I used the method described above and I get the following error:

Workflow undefined, maybe missing global qualifier

The error is caused by the UI Action condition:

!current.isNewRecord() && (new Workflow().hasWorkflow(current))   

I think it has to do with the scope of the application and the fact that Workflow is not accessible from there.

SOLUTION:


Change the UI Action condition to:

!current.isNewRecord() && (new global.Workflow().hasWorkflow(current))   

Change the UI Action script to:

// Show the workflow context in a new window

function showWorkflowContext() {

    var id = g_form.getUniqueValue();

    var url = new GlideURL('context_workflow.do');

    url.addParam('sysparm_stack', 'no');

    url.addParam('sysparm_table', g_form.getTableName());

    url.addParam('sysparm_document', id);

    var w = getTopWindow();

    w.popupOpenFocus(url.getURL(), 'show_workflow_context', 950, 700, '', false, false);

}

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Amado,



Thanks for the update. I am glad I can be helpful


View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Amado,



Thanks for the update. I am glad I can be helpful


This was the exact answer to an issue i had after importing a new update set.   Both in Fuji and Geneva, fixed both.


I was weird though that I had to go around the houses to find this answer as it took me to other posts.   It didn't show when search for "Workflow undefined, maybe missing global qualifier" or "Workflow undefined" and "maybe missing global qualifier".


Davina
Giga Contributor

Thank you! I love finding answers quick on the community!


Wendy Peterson
Giga Guru

I am having the same issue but it's wit the Edit Workflow any ideas TIA



2016-05-25_15-12-09.png