Trying to use the action framework to directly call Apex, but the skuid page doesn’t seem to recognize my invocable variable when it is actually executed. Is there any better documentation out there on this? It would be a great feature to utilize.
Here’s what I have set up in the Skuid configuration:
!(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161207-75380-1144zc2-Edit_Page Account_ Salesforce_-_Enterprise_Edition_inline.png “Image https//d2r1vs3d9006apcloudfrontnet/s3_images/1520184/RackMultipart20161207-75380-1144zc2-Edit_Page__Account___Salesforce_-_Enterprise_Edition_inlinepng1481150573”)
And here’s my apex code:
@InvocableMethod(label='Recalculate Region Assignment')
global static List<assignmentresponse> setOwner(List<assignmentrequest> assignmentRequests) { List<assignmentresponse> responses = new List<assignmentresponse>(); AssignmentResponse res = new AssignmentResponse(); responses.add(res); System.debug('uh... hello?'); Id accountId = assignmentRequestsn0].accountId; Account account = aSELECT Id, GroupsRegion__c FROM Account WHERE Id = :accountId]; Repository.RegionAssignment regionAssignment = new Repository.RegionAssignment(); new AssignmentService(regionAssignment).setOwner(account); update account; return responses; } global class AssignmentRequest { @InvocableVariable(required=true description='The account Id needed' label='Account Id') global Id accountId; } global class AssignmentResponse { @InvocableVariable global String message = 'OHHH yeaaaaaa!'; }
Calling this action results in the following error:
Seems strange that the invocable variable is not found, considering the skuid configuration was able to populate it in my first screenshot. Any idea what I could be doing wrong?