PD1 Process Automation & Logic 4 β Questions and Answers
Question 1: Which type of Flow is triggered automatically when a record is created or updated without any user interaction?
- Screen Flow
- Autolaunched Flow (No Trigger)
- Record-Triggered Flow (Correct answer)
- Scheduled Path Flow
Correct answer: Record-Triggered Flow
A Record-Triggered Flow fires automatically based on create or update events on a specific object, without user interaction.
Question 2: What happens when an unhandled exception occurs in an Apex after-insert trigger?
- Only the trigger's DML changes are rolled back, preserving the original insert
- The entire transaction, including the original DML that fired the trigger, is rolled back (Correct answer)
- The trigger silently fails and logs an error to the debug log only
- Salesforce retries the trigger up to three times automatically
Correct answer: The entire transaction, including the original DML that fired the trigger, is rolled back
An unhandled exception rolls back the entire transaction, including the original record insert that fired the trigger.
Question 3: A developer uses `System.enqueueJob()` to add a Queueable Apex job. What is the maximum number of Queueable jobs that can be chained in a single transaction in production?
- 1 (Correct answer)
- 5
- 50
- Unlimited
Correct answer: 1
Only one Queueable job can be enqueued per transaction in production; chaining allows each job to enqueue exactly one more.
Question 4: Which SOQL clause should a developer use to prevent row-lock contention during record updates in a high-volume trigger?
- FOR UPDATE (Correct answer)
- FOR VIEW
- FOR REFERENCE
- LIMIT 1
Correct answer: FOR UPDATE
`FOR UPDATE` locks the queried rows to prevent other transactions from modifying them concurrently, reducing deadlock risk.
Question 5: In a Record-Triggered Flow running in Before-Save context, what is the key advantage over After-Save context?
- It can perform DML on related records without consuming DML limits
- It can update the triggering record without a separate DML statement, reducing governor limit consumption (Correct answer)
- It has access to the $Record__Prior global variable
- It runs after all validation rules have passed
Correct answer: It can update the triggering record without a separate DML statement, reducing governor limit consumption
Before-Save flows update the triggering record directly without an extra DML operation, unlike After-Save flows which require a separate update.
Question 6: Which Apex annotation allows a method to run in system mode, ignoring the current user's sharing rules?
- @AuraEnabled
- @InvocableMethod
- @TestSetup
- There is no annotation; use `without sharing` on the class instead (Correct answer)
Correct answer: There is no annotation; use `without sharing` on the class instead
System-mode execution is declared at the class level using the `without sharing` keyword, not through a method-level annotation.
Question 7: A developer adds `try-catch` around a DML statement in a trigger to handle exceptions gracefully. What should they be aware of?
- Catching the exception prevents any rollback and allows the transaction to continue successfully
- The catch block can use addError() to surface a user-friendly message while still rolling back if needed (Correct answer)
- Catching a DMLException automatically commits the successful records
- The catch block has no access to which specific records failed
Correct answer: The catch block can use addError() to surface a user-friendly message while still rolling back if needed
Using addError() in the catch block surfaces a meaningful message to the user while allowing the developer to control rollback behavior.
Which type of Flow is triggered automatically when a record is created or updated without any user interaction?