nerdexam
Salesforce

PDI · Question #165

What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers

The correct answer is C. A method using the @InvocableMethod annotation must be declared as static D. A method using the @InvocableMethod annotation can be declared as Public or Global. E. Only one method using the @InvocableMethod annotqation can be defined per Apex class. Invocable methods must be static, can be public or global, and only one such method is allowed per Apex class.

Submitted by yuki_2020· Apr 18, 2026Logic and Process Automation

Question

What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers

Options

  • AA method using the @InvocableMethod annotation must define a return value.
  • BA method using the @InvocableMethod annotation can have multiple input parameters.
  • CA method using the @InvocableMethod annotation must be declared as static
  • DA method using the @InvocableMethod annotation can be declared as Public or Global.
  • EOnly one method using the @InvocableMethod annotqation can be defined per Apex class.

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    93% (27)

Why each option

Invocable methods must be static, can be public or global, and only one such method is allowed per Apex class.

AA method using the @InvocableMethod annotation must define a return value.

An invocable method is not required to define a return value and can have a `void` return type, although it can return a `List`.

BA method using the @InvocableMethod annotation can have multiple input parameters.

An invocable method can only have one input parameter, which must be a `List` of a primitive, sObject, or user-defined type.

CA method using the @InvocableMethod annotation must be declared as staticCorrect

Invocable methods are designed to be called from external processes (like Flow or Process Builder) without an instance of the class, thus they must be declared static.

DA method using the @InvocableMethod annotation can be declared as Public or Global.Correct

For invocable methods to be accessible to external processes, they must have either public or global access modifiers.

EOnly one method using the @InvocableMethod annotqation can be defined per Apex class.Correct

Salesforce restricts the use of @InvocableMethod to a single method per Apex class to ensure clear entry points and predictability when invoked from declarative tools.

Concept tested: Apex Invocable Methods

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm

Topics

#Apex#Invocable Methods#Apex Annotations#Flow Integration

Community Discussion

No community discussion yet for this question.

Full PDI Practice