Platform Developer 2 Exam Flashcards
What annotation is needed on an Apex class to make it available to be called from a flow/process builder?
@InvocableMethod
What element do you use in Flow Builder to invoke Apex code?
Apex Action
What tag is used to embed a flow in a Visualforce page?
<flow:interview> component
</flow:interview>
How can you call a flow from Apex?
By using the Start method of the Interview class
What are the Invocable Method requirements?
Method requirements:
- must be static
- public or global
- annotated with @InvocableMethod
How many method parameters can an Invocable Method have?
<= 1
How many methods can be annotated with the @InvocableMethod annotation in an Apex class?
Only one
Can you use multiple annotations on an @InvocableMethod method?
Nope
What data structure & type must the parameter be for an Invocable Method?
List (List of List works as well). Can be a specific or generic sObject type
What data structure & type must the return type be for an Invocable Method?
List (List of List works as well). Can be a specific or generic sObject type
Where can you call an @InvocableMethod from?
Process builder, Flow, REST API
What is an @InvocableVariable?
Annotation in a class with an @InvocableMethod that allows the variables to be accessible in the @InvocableMethod
Who is the running user for the @InvocableMethod?
The running user that triggered the process
What are the 3 advanced options in Apex action flow elements?
- (recommended) Flow decides at run time
- Apex action always runs in a different transaction
- Apex action always runs in the same transaction
Where can you embed a flow?
LWC, Aura, VF page
Can you embed a LWC in a flow?
Yes
How do you embed a LWC in a flow?
In the config file, add a target & targetConfig tag (ex. below)
<targets>
<target>lightning\_\_FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig>
<property></property>
</targetConfig>
</targetConfigs>
___________________________________________________________
In the js file, use the @api decorator to expose the property in the screen flow (ex. below)
@api strName;
For a LWC that is embedded in a flow, how can you customize the property editor?
In the config file, add the configurationEditor tag with the name of the other component to the targetConfig tag (ex. below)
<targetConfigs>
<targetConfig>
<property></property>
</targetConfig>
</targetConfigs>
Javascript question: What does a variable with a prefix of “_” indicate? Ex.
_myVar
anotherVar
The prefix with an underscore is a convention that indicates the variable is private. JS doesn’t actually enforce it, but it helps to indicate author intent
What is the Process.Plugin interface?
Precursor to @InvocableAction. @InvocableAction is preferenced now
What are some declarative tools?
- formula fields, roll-up summary fields, validation rules, approval processes, workflowr ules, Process Builder, Flow Builder, ReportBuilder, etc
What are some benefits of declarative tools?
- Easier to build and edit
- Get automatic upgrades
- Some aren’t subject to governor limits (ex. roll-up summary fields)
When is code needed?
- Custom UI (Lightning components (Aura or LWC))
- Apex needed for web services, email services, complex validation over multiple objects
- REST or SOAP integrations
- Regularly processing a large number of records
Can you share records using flow?
Yes