function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jamesmelvjamesmelv 

Returning an SObject in an InvocableMethod fails

I've documented here what I think is a defect with how SObjects are returned into a flow from an InvocableMethod: http://salesforce.stackexchange.com/questions/68718/returning-an-sobject-in-an-invocablemethod.

Basically when returning an SObject with field values queried into a flow, the field values are not accessible to the flow. The documentation states that SObjects can be returned by an InvocableMethod. I've writted a test class against the InvocableMethod that validates the returned object, and the test passes. I've also successfully returned strings into the flow.

I've searched known issues and the boards and not found anything related. Can anyone help?
ShashankShashank (Salesforce Developers) 
As per this documentation: http://docs.releasenotes.salesforce.com/en-us/spring15/release-notes/rn_forcecom_flow_apex.htm

"The Cloud Flow Designer doesn’t support mapping an Apexmethod’s input or output parameters to an sObject collection variable."

This could be the reason. Please have a look.