This is the scenario: I had a VF page call a controller extension,that would have some criteria and redirect the user to a different page (or not, depending on the criteria). Now, everything starts with a flow and that flow has to call my controller extension. When I pass a variable from the flow into that controller, I need to redirect the user to different pages(depending on the criteria True/False). How can I accomplish this?
Short answer is No. Please refer Invocable Method Consideration
If the return type is not
Null, the data type returned by the method must be one of the following:
- A list of a primitive data type or a list of lists of a primitive data type – the generic Object type is not supported.
- A list of an sObject type or a list of lists of an sObject type – the generic sObject type is not supported.
- A list of a user-defined type, containing variables of the supported types and with the InvocableVariable annotation. Create a custom global or public Apex class to implement your data type, and make sure your class contains at least one member variable with the invocable variable annotation.