How to override a Salesforce Object UI with a Flow?
Its often better for instances of your Flows to appear as records in Salesforce. This allows users to simply open a running Flow as easily as they open a record. ManyWho automatically manages the state so the Flow will always continue from where you left off. This is how you do it…
- Create an Object in Salesforce
- Create a new Field for this Object called: JoinUri (it should be a URL field)
- Go to Apex and open the ManyWhoFlowController
- Copy the code and create a new Apex class. Paste the code into the new class.
- Change the name to ManyWhoFlowNameOfObjectController (all instances of ManyWhoFlowController)
- Change every instance of ManyWhoFlow__c to your object name __c
- Save the class
- Clone the visualforce page and give it a name
- Change the controller to the name of your controller. Change the standardController=”ManyWhoFlow__c” to your object name
- Change all instances of object-id to id
- Need to hard code the flow-id for this to work
- Save the page
- Go to the Object in salesforce
- In the Buttons, Links and Actions section, change the Edit, View, New views to your VF page.
- Make sure you refresh the Service to get the latest object changes
- Create an operator in your Flow
- Create a Value for your Object
- Set the JoinUri property to the $JoinUri system Value
- Create a Database Save
- Save your Value back to Salesforce (this will create the record and associate that record with the instance of the Flow)