Workflow undefined, maybe missing global qualifier

prashantgadgil
Kilo Contributor

Hello All, I have a workflow called "Sample Workflow" in one custom scoped app. I am trying to start it in a UI action from another custom scoped app.

 

var wf = new Workflow();

var   wfId = wf.getWorkflowFromName("Sample Workflow");

var vars = {};

vars.u_var1 = var1_value;

wf.startFlow(wfId, null, "Sample Workflow", vars);

 

When I click on the UI action, I am getting an error which says "Workflow undefined, maybe missing global qualifier"

Does anyone have any pointers on what is missing? how do I declare global qualifier?

Thanks in Advance

 

Prashant

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Prashant,



Easy fix. Add global. in front of your Workflow instantiation.



var wf = new global.Workflow();


var   wfId = wf.getWorkflowFromName("Sample Workflow");


var vars = {};


vars.u_var1 = var1_value;


wf.startFlow(wfId, null, "Sample Workflow", vars);


View solution in original post

14 REPLIES 14

Chuck Tomasi
Tera Patron

Hi Prashant,



Easy fix. Add global. in front of your Workflow instantiation.



var wf = new global.Workflow();


var   wfId = wf.getWorkflowFromName("Sample Workflow");


var vars = {};


vars.u_var1 = var1_value;


wf.startFlow(wfId, null, "Sample Workflow", vars);


Hello Chuck,

Is there some documentation on "global" object? Iwould like to read more, but cannot find anything.

Can you provide some details of what you are looking for or where you have seen this used? Normally, you specify "global." in front of something if you are using it from a scoped app. It's not so much an object as explicitly specifying items from another scope. Much like sn_ws.RESTMessageV2().

If I'm not getting the right point, please let now with examples and details. Thanks

Hi Chuck--know the cause of this when it's a workflow tied to a table/condition and not one called from a WF? I have a record producer creating the record (scoped app) from the service portal. When I run a test and navigate to the newly generated record, I get the error.