Salesforce PDII Exam (page: 9)
Salesforce Certified Platform Developer II
Updated on: 25-Dec-2025

Viewing Page 9 of 86

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?

  1. insert (records, false)
  2. Database.insert(records, false)
  3. Database.insert(records, true)
  4. insert records

Answer(s): B



Which two relationship queries use the proper syntax? (Choose two.)

  1. SELECT Id, Name, Account r.Name FROM Contact WHERE Account r.Industry = 'Media'
  2. SELECT Name, (SELECT LastName FROM Contacts r) FROM Account
  3. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
  4. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media'

Answer(s): C,D



A developer built a Component to be used at the front desk for quests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk.
What should be used?

  1. Application Event
  2. DML Operation
  3. Component Event
  4. ChangeLog

Answer(s): A



Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?

  1. List <Contact> contactList = new List <Contact>();
    for(Opportunity o : opportunityList){
    Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId]
    contactList.addAll(a.Contacts);
    )
  2. List <Contact> contactList = new List <Contact>();
    Set <Id> accountIds = new Set <Id> ();
    for (Opportunity o : opportunityList){
    contactIds.add(o.ContactId);
    }
    for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){
    contactList.add(c);
    }
  3. List <Contact> contactList = new List <Contact>();
    Set <Id> accountIds = new Set <Id> ();
    for(Opportunity o : opportunityList){
    accountIds.add(o.AccountId);
    }
    for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){
    contactList.addAll(a.Contacts);
    }
  4. List <Contact> contactList = new List <Contact>();
    for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){
    contactList.add(c);
    }

Answer(s): C



An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.

When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.

What is the most extendable way to update the Apex Trigger to accomplish this?

  1. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
  2. Use a List Custom Setting to disable the Trigger for the user who does the data loading.
  3. Add the Profile Id of the user who does the data loading to the Trigger so the Trigger won’t fire for this user.
  4. Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.

Answer(s): A



Viewing Page 9 of 86



Share your comments for Salesforce PDII exam with other users:

Farooqi 11/21/2023 1:37:00 AM

good for practice.
INDIA