You need to sign in to do that
Don't have an account?
Tony Parfitt
Why doesn't my invocablemethod appear in Apex in Visual Workflow?
I've created an invocablemethod to perform some business logic processing and was going to use visual workflow to habdle the UI side of things as the method requires some inputs from the user. The method runs through test cases with 100% coverage and no errors, and I;ve checked using debug messaages that it is actually doing what it is supposed to do.
However, when I create a visual workflow for the UI, I don't get an "Apex" section in the pallette, nor of course the class that should appear there. Are there any gotchas that might mean my class or the section is not displaying? I have been looking high and low for the sulution on the web and several hours later am about to give up and use a VF page instead.
However, when I create a visual workflow for the UI, I don't get an "Apex" section in the pallette, nor of course the class that should appear there. Are there any gotchas that might mean my class or the section is not displaying? I have been looking high and low for the sulution on the web and several hours later am about to give up and use a VF page instead.
could you please check you apex class format it should follow the basics.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm
and FYI Apex class being displayed in Flow like.
Let me know if this helped you.
Thanks
Lokesh
global class IncrementContracts{
global class IncrementContractsRequest{
//Input value(s)
@InvocableVariable(label='CPI' required=true)
public Decimal CPI;
@InvocableVariable(label='Division' required=true)
global String division;
@InvocableVariable(label='Region' required=true)
global String region;
}
@InvocableMethod(label='Increment Contracts' description='Increment active annually renewable contracts by input CPI or the fixed percentage in the contract')
public static List<Boolean> incrementContracts(List<IncrementContractsRequest> requests){
List<Boolean> results = new List<Boolean>();
for (IncrementContractsRequest request : requests) {
// Execute the change
contractsHandler.processIncrements(request.division, request.region, request.CPI);
results.add(TRUE);
}
return results;
}
}
Please create a dummy apex class with the below code and see if this is available for use in flow or not.
Thanks
Lokesh
I might try remaking the class, perhaps there's something up with it that I can't see. Will update this thread when I find the problem in case it helps anyone else in future... couldn't find any existing threads like this one.