You need to sign in to do that
Don't have an account?
Karleen Mendoza
Launch screen flow when task closed
Hi all, I'd like to create a screen flow that asks users a few questions and then this would update the related opportunity. I'd like this screen flow to trigger when a task related to the opportunity is closed. How do I pass through the related opportunity ID?
Only autolaunched flows can be triggered on data changes and an autolaunched flow have no user interface context to display a page.
If you are in Classics, there is just the URL hack using retURL for a redirection from a standard record edit layout at the save to a VFP that will launch the flow with your screen. The URL hack only works in Classics.
1) Override the Edit button of Task with a Visualforce page that will just do the redirection to the standard edition of a task with &retURL=/apex/myFlow?id=
VFP for the override of the button "Edit" task Simplified controller:
2) When you save the task, /apex/CallFlow?id='+ t.whatid (retURL) will be called automatically
CallFlow is VFP embedding the flow interview.
Minimal code without passing the id:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_adding.htm
Here’s an example of a custom controller that sets the values of flow variables in a constructor:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_advanced.htm
This trick has been over-used because that doesn't work anymore with Lightning so that will have a big problem when you will want to migrate to Lex.
This trick has been over-used because that doesn't work anymore with Lightning so you will have a big problem when you want to migrate to Lex.
If you have a workaround without an URL hack (even the name is terrible), you will achieve peace of mind for the future.
This URL hacks may be tempting (only known alternative in Classics only) but they are dangerous.