Salesforce Platform Developer I (legacy) — Question 82
What are three considerations when using the @InvocableMethod annotation in Apex? (Choose three.)
Answer options
- A. A method using the @InvocableMethod annotation must be declared as static.
- B. A method using the @InvocableMethod annotation can be declared as Public or Global.
- C. A method using the @InvocableMethod annotation can have multiple input parameters.
- D. A method using the @InvocableMethod annotation must define a return value.
- E. Only one method using the @InvocableMethod annotation can be defined per Apex class.
Correct answer: A, B, E
Explanation
The correct answers, A, B, and E, highlight the requirement for the method to be static, the possible access modifiers, and the restriction on the number of such methods in a class. Options C and D are incorrect as the @InvocableMethod can only have one input parameter and does not require a return value.