var request = {
'type' : 'executeFSLFlow',
'data' : {
'FlowName' : 'Sales_Funnel_Flow1', /* (Required if FlowId is blank) The Flow's Salesforce API name */
'FlowId' : '30123456789ABCDEFG', /* (Required if FlowName is blank) The Id of the Flow version */
'ActionLabel' : 'Pre-sale Form Flow', /* (Optional) A user-friendly name that will display in the Flow Window
similar to that used when configuring a Field Service Mobile Settings App Extension name */
/* The following are expected flow input variables in Field Service Mobile Flows */
'Id' : '08p23456789ABCDEFG', /* (Optional) The ID of the record that the flow is launched from. */
'UserId' : '00523456789ABCDEFG', /* (Optional, Automatically defaults to Current User Id) The ID of the current user. */
'ParentId' : '0WO23456789ABCDEFG', /* (Optional) The record ID of the parent record that the flow is launched from.
For example, if a flow is launched from a service appointment,
the ParentId is the ID of the parent work order or work order line item. */
}
};
bridge.sendRequest(request, function(responseData) {
if ((responseData.type === 'executefslflowResponse')
&& (responseData.data != null))
{
var responseObject = responseData.data;
/* the response object contains one property:
"executed" : the execution state of the flow- true if the flow was presented to the user. false otherwise
*/
} else {
// handle the API error ...
}
}); |