PD1 Process Automation & Logic 3 — Questions and Answers
Question 1: Which governor limit applies per synchronous Apex transaction regardless of how many triggers or classes are involved?
- 100 SOQL queries per class
- 150 DML statements per transaction
- 50,000 SOQL rows returned per transaction
- All of the above apply per transaction (Correct answer)
Correct answer: All of the above apply per transaction
All Apex governor limits—SOQL queries, DML statements, and SOQL rows—apply cumulatively across the entire synchronous transaction, not per class.
Question 2: A developer needs to call an external REST API from a trigger asynchronously. Which Apex feature is most appropriate?
- Synchronous callout within the trigger
- Future method annotated with @future(callout=true) (Correct answer)
- Schedulable class called from the trigger
- Platform Cache to store the endpoint URL
Correct answer: Future method annotated with @future(callout=true)
Callouts from triggers must be asynchronous; a `@future(callout=true)` method runs after the transaction commits and allows HTTP callouts.
Question 3: What is the maximum number of records a single Apex Batch `execute()` method can process per batch chunk by default?
- 50
- 200 (Correct answer)
- 2,000
- 10,000
Correct answer: 200
The default batch size for Apex Batch is 200 records per execute() call, though a custom size can be set in Database.executeBatch().
Question 4: A developer writes a SOQL query inside a for loop in a trigger. What problem does this cause?
- Compile error because SOQL is not allowed inside loops
- Risk of hitting the 100 SOQL queries per transaction governor limit (Correct answer)
- The loop will not iterate over all Trigger.new records
- Field-level security is bypassed inside loops
Correct answer: Risk of hitting the 100 SOQL queries per transaction governor limit
Each loop iteration issues a new SOQL query, quickly consuming the 100-query limit in bulk operations—this is an anti-pattern to avoid.
Question 5: Which statement about Process Builder is TRUE as of Salesforce's recommended best practices?
- Process Builder is the preferred tool for all new automation
- Process Builder should be migrated to Flow Builder as it is being retired (Correct answer)
- Process Builder supports before-save record updates natively
- Process Builder can make HTTP callouts directly without Apex
Correct answer: Process Builder should be migrated to Flow Builder as it is being retired
Salesforce has announced Process Builder retirement; developers should build new automation in Flow Builder and migrate existing processes.
Question 6: In Apex, what does the `Database.insert(records, false)` method do differently from `insert records`?
- It inserts records in a separate transaction
- It allows partial success, returning results for each record without throwing an exception on failure (Correct answer)
- It bypasses validation rules for all records
- It inserts records synchronously and blocks the UI
Correct answer: It allows partial success, returning results for each record without throwing an exception on failure
`Database.insert(records, false)` uses allOrNothing=false, permitting some records to fail while others succeed and returning a SaveResult array.
Question 7: A developer needs logic that fires only when a specific field changes from a non-null value to null. Which trigger context variable is most useful?
- Trigger.oldMap (Correct answer)
- Trigger.newMap
- Trigger.isUpdate
- Trigger.operationType
Correct answer: Trigger.oldMap
`Trigger.oldMap` contains the pre-update field values, allowing comparison with Trigger.new to detect changes from a previous value to null.
Which governor limit applies per synchronous Apex transaction regardless of how many triggers or classes are involved?