logo
Exam overview and study plan

Platform Developer II Practice Questions

Salesforce Certified Platform Developer II

Read questions, check verified answers and discuss the reasoning. Use reading options to shape your revision, or switch to the simulator for timed practice.

View 58 free questions

58 questions in this view

Page 1 of 10

Question 1

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.

What is the optimal way to implement these requirements?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.

Question 2

Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__c, on the Account object that allows sales reps to specify which of UC’s products an Account already has.  A developer is tasked with writing an Apex method that retrieves Account records, including the Products__c field.

What should the developer do to ensure the value of Products__c is in the current user’s language?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.

Question 3

Which statement is considered a best practice for writing bulk safe Apex triggers?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.

Question 4

Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called Candidate was created with organization-wide defaults set to Private. A lookup on the Candidate object sets an employee as an Interviewer.
 
What should be used to automatically give Read access to the record when the lookup field is set to the Interviewer user?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.

Question 5

A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.

A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.

What should the developer do to ensure the parent always has a child record?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.

Question 6

A developer wrote the following method to find all the test accounts in the org:

    public static Account[] searchTestAccounts(){
        List<List<SObject>> searchList = [ FIND 'test' IN ALL FIELDS 
                                           RETURNING Account(Name)];
        return (Account[]) searchList[0];
    }


However, the test method below fails.

    @isTest
    public static void testSearchTestAccounts(){
        Account a = new Account(name='test');
        insert a;
        Account [] accounts = TestAccountFinder.searchTestAccounts();
        System.assert(accounts.size() == 1 );
    }


What should be used to fix this failing test?

Select an answer above, then submit your vote. Reading or practicing does not cast a vote.