3

I am trying to learn about these two annotations that has been introduced as Spring 15 release. Can anyone please explain why and under what circumstances do we need to use these two annotations. An example would be great.

Thanks in advance.

  • The question Can't invoke @InvocableMethod via the REST API gives a working example of calling the resulting REST service with workbench. – Daniel Ballinger May 5 '15 at 8:18
  • I saw this Daniel. Thank you. I just wanted to understand this in simple words and then dig deeper into various blogs. Do you think you can help me with that? – the_phantom May 5 '15 at 8:20
  • InvocableVariable allows you to "a class variable used as an input or output parameter for an InvocableMethod method’s invocable action". – Daniel Ballinger May 5 '15 at 8:20
  • @sfdcfox - Could you please explain the solution to this question based on your person experience and findings? – the_phantom May 30 '15 at 16:10
4

As per the Spring 15 release notes. @InvocableMethod exists to make it easier for a flow to call a method on an Apex class. It has some limitations around the supported data types that can be passed to the method, but should be simpler than implementing the Process.Plugin Interface

Have a look at the example in the release notes that demonstrates getting the account ids by name. The @InvocableMethod is much shorter (11 lines to 28) and more straight forward to follow. As noted, the shorter version is also more efficient when dealing with multiple records.

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.