0

is it possible set a value of variable of flow thanks apex class using a button in the visualforce? I try to explain myself better, I have a flow and a custom button in a visualforce, i would like that after click of button the field of flow is populated with a value that I defined in apex class. enter image description here

1

You can set variables of flow from its' url.

There are various types of Flow variables. Use Input and Output variable in your case. You can use such variable in url and pass its' value to the flow from apex. Your method can be something like this.

public Pagereference openMyFlow() {

    String myVariableValue = 'some value';
    String flowUrl = '/flow/My_test_Flow?myIOvariable=' + myVariableValue;
    Pagereference pr = new Pagereference(flowUrl);

    return pr;
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.