The approach is to use a VF page and controller. The Apex class (or even a custom button) builds the URL to the VF page and the controller sets the params to the Flow. For specifics, refer to the Flow Designer Dev Guide.
No . You cannot access FLow in Apex . In salesforce , We cannot query information about flow.Its not exposed to developer . we can make a Metadata Callout to get information but this also contain very basic information(Metadata) .
Have you got a solution for this ? I am trying to call a Flow from apex using Flow.Interview.start() method.But it is goving runtime exception as common.apex.runtime.impl.ApexExecutionException: Start can only be called on a trigger-ready flows
It is now possible with Trigger Ready flows (submit a case with SF support to get into the Pilot) . Here is a great post for implementing it: http://andyinthecloud.com/2014/10/26/calling-flow-from-apex/ you can freely pass variables between flows and APEX classes/Triggers
Yes sure. The way that you have to use is as follow:
//Creating a Map to pass parameters to the flow. For example
Map<String, Object> flowMap = new Map<String, Object>();
flowMap.put('request', new Case(Id = requestId));
//Instantiating and launching the flow with the parameters
Flow.Interview.Unique_Name_Flow myFlow = new Flow.Interview.Unique_Name_Flow myFlow(flowMap);
myFlow.start();
//Getting Output parameters from the flow
String localOutputParameter = (String)myFlow .getVariableValue('outputParameter');
The approach is to use a VF page and controller. The Apex class (or even a custom button) builds the URL to the VF page and the controller sets the params to the Flow. For specifics, refer to the Flow Designer Dev Guide.
No . You cannot access FLow in Apex . In salesforce , We cannot query information about flow.Its not exposed to developer . we can make a Metadata Callout to get information but this also contain very basic information(Metadata) .
common.apex.runtime.impl.ApexExecutionException: Start can only be called on a trigger-ready flows
Any workaround for this?
Best,
Alex
The way that you have to use is as follow:
Regards