Platform Developer 2 Exam Flashcards

1
Q

What annotation is needed on an Apex class to make it available to be called from a flow/process builder?

A

@InvocableMethod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What element do you use in Flow Builder to invoke Apex code?

A

Apex Action

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What tag is used to embed a flow in a Visualforce page?

A

<flow:interview> component
</flow:interview>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you call a flow from Apex?

A

By using the Start method of the Interview class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the Invocable Method requirements?

A

Method requirements:
- must be static
- public or global
- annotated with @InvocableMethod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How many method parameters can an Invocable Method have?

A

<= 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many methods can be annotated with the @InvocableMethod annotation in an Apex class?

A

Only one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can you use multiple annotations on an @InvocableMethod method?

A

Nope

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What data structure & type must the parameter be for an Invocable Method?

A

List (List of List works as well). Can be a specific or generic sObject type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What data structure & type must the return type be for an Invocable Method?

A

List (List of List works as well). Can be a specific or generic sObject type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Where can you call an @InvocableMethod from?

A

Process builder, Flow, REST API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an @InvocableVariable?

A

Annotation in a class with an @InvocableMethod that allows the variables to be accessible in the @InvocableMethod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Who is the running user for the @InvocableMethod?

A

The running user that triggered the process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 3 advanced options in Apex action flow elements?

A
  1. (recommended) Flow decides at run time
  2. Apex action always runs in a different transaction
  3. Apex action always runs in the same transaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where can you embed a flow?

A

LWC, Aura, VF page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Can you embed a LWC in a flow?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you embed a LWC in a flow?

A

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;

18
Q

For a LWC that is embedded in a flow, how can you customize the property editor?

A

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>

19
Q

Javascript question: What does a variable with a prefix of “_” indicate? Ex.
_myVar
anotherVar

A

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

20
Q

What is the Process.Plugin interface?

A

Precursor to @InvocableAction. @InvocableAction is preferenced now

21
Q

What are some declarative tools?

A
  • formula fields, roll-up summary fields, validation rules, approval processes, workflowr ules, Process Builder, Flow Builder, ReportBuilder, etc
22
Q

What are some benefits of declarative tools?

A
  • Easier to build and edit
  • Get automatic upgrades
  • Some aren’t subject to governor limits (ex. roll-up summary fields)
23
Q

When is code needed?

A
  • 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
24
Q

Can you share records using flow?

25
Can a flow be triggered by a platform event?
Yes
26
How can you process an email to a case?
- Simple scenario: Email-to-Case configuration - Complex scenario: Apex Email Handler"
27
What is Apex Email Service?
Apex class that can receive and process incoming emails to a specific generated email address. Can define parameters around which email senders are allowed
28
Can you rollback records in a flow?
Yes
29
How can you set the order of flows that are running on a single obj?
In Flow Trigger Explorer there's an "Edit Order" button where you can set it appropriately
30
What's the max number of scheduled Apex jobs that you can have at one time?
100
31
When should you use a SOQL for loop?
When there may be a large number of query results (it processes it in batches)
32
How can you handle trigger recursion?
Use a static boolean to determine if the trigger has run already
33
When are the Limit methods helpful?
Can be used to check if you're going to exceed governor limits
34
How many @future methods can be invoked per method?
50
35
What is an unhandled exception?
- Code that can't handle an error that occurs during a transaction - Code terminates & all changes are rolled back - Salesforce sends an email notification - UI notification is shown to user - Noted in the debug log
36
What are some options for error handling?
- addError() to an sObject record - try/catch/finally statements - Error class methods that can be used: getMessage(), getFields(), and getStatusCode methods
37
What are some types of exceptions?
- DmlException - ListException - NullPointerException - QueryException (trying to set SOQL results to a single sObj instead of a list) - SObjectException (trying to access a field that wasn’t retrieved in a SOQL query) - LimitException (these can’t be caught) - CustomException - MixedDML
38
What is the safe navigation operator?
a=b?.c means - if b is not null, set a = b.c - if b is null, set a = null
39
What is the MixedDmlException
When a single transaction performs DML operations for both a setup object such as a User record and a non-setup object such as an Account record, a Mixed DML error is thrown.
40
What is the syntax for a CustomException?
if(somethingHappens) throw new CustomException(’Failure!’);
41
What keyword is used to specify a starting row offset into the result rest returned by a query?
OFFSET