Salesforce Certified Platform Developer II Exam Practice Questions (P. 2)
- Full Access (424 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #11
A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system
(OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce.
What is the optimal method to implement this?
(OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce.
What is the optimal method to implement this?
- AGenerate the Enterprise WSDL and use it to make a callout to the OMS.
- BGenerate the Partner WSDL and use it to make a callout to the OMS.
- CCreate an Outbound Message that contains the session ID and send it to the OMS.Most Voted
- DCreate an Apex trigger and make a callout to the OMS from the trigger.
Correct Answer:
A
A
send
light_mode
delete
Question #12

Consider the Apex controller above, that is called from a Lightning Aura Component.
What is wrong with it?
- ALine 1: class must be global
- BLines 1 and 6: class and method must be global
- CLine 6: method must be staticMost Voted
- DLine 8: method must first serialize the list to JSON before returning
Correct Answer:
C
C
send
light_mode
delete
Question #13
An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class.
How can the developer generate the code coverage?
How can the developer generate the code coverage?
- AVerify the user has permissions passing a user into System.runAs().
- BCall the Apex class method from a testMethod instead of the testSetup method.
- CAdd @testVisible to the method in the class the developer is testing.
- DUse system.assert() in testSetup to verify the values are being returned.
Correct Answer:
B
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm
B
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm
send
light_mode
delete
Question #14
A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.
Which functionality consideration impacts the final decision?
Which functionality consideration impacts the final decision?
- ADoes the screen need to be rendered as a PDF?Most Voted
- BDoes the screen need to be accessible from the Lightning Experience UI?
- CWill the screen make use of a JavaScript framework?
- DWill the screen be accessed via a mobile app?
Correct Answer:
C
C
send
light_mode
delete
Question #15
A developer wishes to improve runtime performance of Apex calls by caching results on the client.
What is the best way to implement this?
What is the best way to implement this?
- ADecorate the server-side method with @AuraEnabled(cacheable=true).Most Voted
- BSet a cookie in the browser for use upon return to the page.
- CCall the setStorable() method on the action in the JavaScript client-side code.
- DDecorate the server-side method with @AuraEnabled(storable=true).
Correct Answer:
C
C
send
light_mode
delete
Question #16
A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to 'Customer' should have a status of 'Active', and Accounts with the type set to 'Prospect' should have a status of 'Pending'. No other changes to data should be made.
Which code block will accurately meet the business requirements?
Which code block will accurately meet the business requirements?
- AMap<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;
- BMap<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account WHERE Status IN :statusMap.keySet()]){ a.Status = statusMap.get(a.Type); accountUpdates.add(a); } update accountUpdates;Most Voted
- CList<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( String.isNotBlank(a.Type) && a.Type == 'Customer' ){ a.Status = 'Active'; } if ( String.isNotBlank(a.Type) && a.Type == 'Prospect' ){ a.Status = 'Pending'; } accountUpdates.add(a); } update accountUpdades;
- DList<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; accountUpdates.add(a); } update accountUpdates;
Correct Answer:
D
D
send
light_mode
delete
Question #17
What is a benefit of JavaScript remoting over Visualforce Remote Objects?
- AAllows for specified re-render targets
- BDoes not require any Apex code
- CDoes not require any JavaScript code
- DSupports complex server-side application logicMost Voted
Correct Answer:
C
C
send
light_mode
delete
Question #18
A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available.
What change should be applied to the component?
What change should be applied to the component?
- AExpose it in the markup using the implements and access attributes.Most Voted
- BDelete the component, metadata, and Apex controller and recreate them.
- CRefresh the sandbox and upgrade it to the latest API version.
- DLook for errors in the logic in the JavaScript controller.
Correct Answer:
A
A
send
light_mode
delete
Question #19
Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce.
The flow of data is as follows:
✑ The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
✑ If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
✑ If a match is not found, the integration will create a Lead and a Task for that newly created Lead.
What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?
The flow of data is as follows:
✑ The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
✑ If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
✑ If a match is not found, the integration will create a Lead and a Task for that newly created Lead.
What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?
- AUse the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period.
- BCreate an Inbound Message that, using Flow, can do all of the logic the integration code was doing.
- CWrite a custom Apex web service that, given an email address, does all of the logic the integration code was doing.Most Voted
- DCreate several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.
Correct Answer:
D
D
send
light_mode
delete
Question #20
A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page.
Which design resource configuration should be used?
Which design resource configuration should be used?
- A<design:component label="Account FS Component"> <design:attribute name="fieldSetName" Label="Field Set Name" /> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
- B<design:component label="Account FS Component"> <design:attribute name="fieldSetName" label="Field Set Name" /> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>Most Voted
- C<design:component label="Account FS Component"> <aura:attribute name="fieldSetName" label="Field Set Name" /> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
- D<design:component label="Account FS Component"> <aura:attribute name="fieldSetName" label="Field Set Name" /> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>
Correct Answer:
B
B
send
light_mode
delete
All Pages