Did you know you can call an Invocable Apex method directly from Apex? ๐
Why does this matter? Enhancing code reusability (modularity) and dynamically invoking different actions at runtime based on conditions (flexibility) are two ideas.
In the 1st attached image there is an example of a custom invocable action returning a customized string response.
Custom Invocable Action: tellMeSomething()
Input: A mascot name.
Output: A customized string response.
The 2nd image shows how the action is leveraged:
1) instantiated with createCustomAction() by passing a string with the name of the class
2) set with the expected parameter with setInvocationParameter()
3) invoke()
๐ Check out Alba Rivas article below:
https://lnkd.in/gf4cmkuU

