Monday, February 4, 2013

How to submit an Asynchoronous Request in eScript

The eScript below helps you to invoke the WF process asynchronously.  Like this we can call any WF process asynchronously from the Business Service / BC / Applet scripts.

var oBS = TheApplication().GetService("Asynchronous Server Requests");

var psInputs = TheApplication().NewPropertySet();

var psOutputs = TheApplication().NewPropertySet();

var psChild = TheApplication().NewPropertySet();

var sObjId = this.GetFieldValue("Id");

psInputs.SetProperty("Component", "WfProcMgr");

psChild.SetProperty("Object Id", sObjId);

psChild.SetProperty("ProcessName", "Sample WF Process Name");

psInputs.AddChild(psChild);

oBS.InvokeMethod("SubmitRequest", psInputs, psOutputs);