You need to sign in to do that
Don't have an account?
vleandro
Calling a Flow from Apex Class/Trigger
Please bear with me as I'll admit coding is something I'm new at and trying to learn!
I create a very simple Flow, called ReturnHelloWorld. It's only job is to display a message (using the Screen element) that says "Hello World!".
I created the following Apex Class:
Thanks for your help!
I create a very simple Flow, called ReturnHelloWorld. It's only job is to display a message (using the Screen element) that says "Hello World!".
I created the following Apex Class:
public class ReturnHelloWorld { Flow.Interview.ReturnHelloWorld helloWorldFlow {get; set;} }I then created the following Apex Trigger to call the Class:
trigger CallMyFlow on Case (after insert) { for (Case c : trigger.New) { ReturnHelloWorld hello = new ReturnHelloWorld(); } }When I create a Case and save it, the Flow is not launched. Based on all the reading and research I've done so far, it seems that really the only way for this to work is to call the Apex Class from a Visualforce page. I wanted to confirm and make sure my code is correct.
Thanks for your help!
You can check out a blog post of mine to get some good coding examples as well! https://techman97.wordpress.com/2013/10/18/flow-and-finishlocation/
All Answers
You can check out a blog post of mine to get some good coding examples as well! https://techman97.wordpress.com/2013/10/18/flow-and-finishlocation/