Certified Platform Developer II Practice Test practice questions, page 3 of 17, with answer review and explanations.
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?
Generate the Enterprise WSDL and use it to make a callout to the OMS.
Generate the Partner WSDL and use it to make a callout to the OMS.
Create an Outbound Message that contains the session ID and send it to the OMS.
Create an Apex trigger and make a callout to the OMS from the trigger.
Question 12
Consider the Apex controller above, that is called from a Lightning Aura Component. What is wrong with it?
Line 1: class must be global
Lines 1 and 6: class and method must be global
Line 6: method must be static
Line 8: method must first serialize the list to JSON before returning
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?
Verify the user has permissions passing a user into System.runAs().
Call the Apex class method from a testMethod instead of the testSetup method.
Add @testVisible to the method in the class the developer is testing.
Use system.assert() in testSetup to verify the values are being returned.
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?
Does the screen need to be rendered as a PDF?
Does the screen need to be accessible from the Lightning Experience UI?
Will the screen make use of a JavaScript framework?
Will the screen be accessed via a mobile app?
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?
Decorate the server-side method with @AuraEnabled(cacheable=true).
Set a cookie in the browser for use upon return to the page.
Call the setStorable() method on the action in the JavaScript client-side code.
Decorate the server-side method with @AuraEnabled(storable=true).