Welcome back to the next (!last) post in UMF series. In this we will discuss how we can capture responses and perform actions from the popup applet. It basically involves two steps:
1 - Creation of business service with different methods which needs to be invoked on selecting responses from message applet.Create a new business service "ResponseService". Add three Methods to this BS:
AddInfo
AssignRequest
OpReq
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
switch(MethodName)
{
case "AssignRequest":
fnAssignReassign(Inputs, Outputs);
return(CancelOperation);
case "AddInfo":
fnAddInfo(Inputs, Outputs);
return(CancelOperation);
case "OpReq":
fnOpReq(Inputs, Outputs);
return(CancelOperation);
}
return(ContinueOperation);
}
The best part is entire payload of the message is passed to the response thus allowing us to use them in response functions.
2 - Now its time to map the business service and methods to the responses. Navigate to Administration - Order Management -> Message Types. Query for "Testing UMF" message. Go to responses tab and map the corresponding Business service and Method to the respective response record.
Once all changes are done. Click on the Popup button and look out for the magic. UMF can be impressive alternate for browser script.
No comments:
Post a Comment