PD1 Process Automation & Logic 5 β Questions and Answers
Question 1: A developer needs to invoke an Apex method from a Flow. Which annotation must the method have?
- @AuraEnabled
- @InvocableMethod (Correct answer)
- @RemoteAction
- @Future
Correct answer: @InvocableMethod
`@InvocableMethod` exposes an Apex method to Flow Builder, Process Builder, and REST API invocable actions.
Question 2: What is the purpose of the `Limits.getQueries()` method in Apex?
- Returns the maximum number of SOQL queries allowed in the transaction
- Returns the number of SOQL queries consumed so far in the current transaction (Correct answer)
- Resets the SOQL query counter to zero
- Throws an exception if the query limit is exceeded
Correct answer: Returns the number of SOQL queries consumed so far in the current transaction
`Limits.getQueries()` returns the current count of SOQL queries executed, helping developers monitor consumption at runtime.
Question 3: Which statement about `Trigger.new` and `Trigger.old` is correct in a delete trigger?
- Trigger.new contains the records being deleted and Trigger.old is null
- Trigger.old contains the records being deleted and Trigger.new is null (Correct answer)
- Both Trigger.new and Trigger.old contain the records being deleted
- Neither collection is available in delete triggers
Correct answer: Trigger.old contains the records being deleted and Trigger.new is null
In delete triggers, `Trigger.old` holds the records being deleted while `Trigger.new` is null because no new version of the record exists.
Question 4: A Scheduled Flow has a scheduled path that runs 3 days after an Opportunity's Close Date. The Opportunity's Close Date is updated. What happens to the pending schedule?
- The scheduled action is re-evaluated based on the new Close Date automatically (Correct answer)
- The scheduled action fires on the original calculated date and ignores the update
- The scheduled action is cancelled and must be manually re-created
- The scheduled action fires immediately when the Close Date is updated
Correct answer: The scheduled action is re-evaluated based on the new Close Date automatically
Record-Triggered Flows with scheduled paths re-evaluate pending schedules when the triggering record is updated, adjusting the execution time accordingly.
Question 5: Which approach should a developer use to test an Apex trigger that processes 200 records to verify bulkification?
- Insert one record in the test method and assert the result
- Insert 200 records in a list within a single DML call and assert results for all records (Correct answer)
- Use Test.setMock() to simulate 200 records without actual DML
- Use @isTest(SeeAllData=true) to pull production records
Correct answer: Insert 200 records in a list within a single DML call and assert results for all records
Inserting 200 records in a single DML statement simulates a bulk trigger invocation and validates that the trigger handles a full batch without hitting limits.
Question 6: A developer wants a Flow to pause and resume execution after an external approval is received. Which Flow element supports this?
- Wait Element (Pause) (Correct answer)
- Decision Element
- Loop Element
- Assignment Element
Correct answer: Wait Element (Pause)
The Wait (Pause) element suspends Flow execution until a defined resume event, such as a time-based condition or platform event, occurs.
Question 7: What is a key difference between `@future` methods and Queueable Apex?
- @future methods can be monitored in Apex Jobs, but Queueable jobs cannot
- Queueable Apex supports passing non-primitive object types as parameters, while @future only supports primitives (Correct answer)
- Queueable Apex cannot be chained, while @future methods can call each other recursively
- @future methods run in Before-Save context, while Queueable runs After-Save
Correct answer: Queueable Apex supports passing non-primitive object types as parameters, while @future only supports primitives
Queueable Apex accepts complex object types (like sObjects) as parameters, whereas `@future` methods are limited to primitive data types and arrays of primitives.
A developer needs to invoke an Apex method from a Flow.
Which annotation must the method have?