Online Access Free PDII Exam Questions
| Exam Code: | PDII |
| Exam Name: | Platform Developer II |
| Certification Provider: | Salesforce |
| Free Question Number: | 163 |
| Posted: | Sep 01, 2026 |
Consider the following code snippet:
HTML
<c-selected-order>
<template for:each={orders.data} for:item="order">
<c-order orderId={order.Id}></c-order>
</template>
</c-selected-order>
How should the <c-order> component communicate to the <c-selected-order> component that an order has been selected by the user?
The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error. What should be done to address the problem?
Java
public void updateAndMakeCallout(Map<Id, Request__c> regs, Map<Id, Request_Line__c> regLines) { Savepoint sp = Database.setSavepoint(); try { insert regs.values(); insert regLines.values(); HttpResponse response = CalloutUtil.makeRestCallout(regs.keySet(), regLines.keySet());
} catch (Exception e) {
Database.rollback(sp);
}
}
Given the following code:
Java
for ( Contact c : [SELECT Id, LastName FROM Contact WHERE CreatedDate = TODAY] )
{
Account a = [SELECT Id, Name FROM Account WHERE CreatedDate = TODAY LIMIT 5]; c.AccountId = a.Id; update c;
}
Assuming there were 10 Contacts and five Accounts created today, what is the expected result?
A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process. During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a runtime error occurs. Why does the developer receive a runtime error?