|Exam Name||:||Salesforce Certified Platform Developer II (PDII)|
|Questions and Answers||:||382 Q & A|
|Updated On||:||Click to Check Update|
|PDF Download Mirror||:||PDII Brain Dump|
|Get Full Version||:||Pass4sure PDII Full Version|
A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system.
What is the optimal way to update the Accounts from the external system? A . Bulk API
B . SOAP API
C . Apex REST Web Service D . Composite REST API
B . Does not require any Apex code
D . Supports complex server-side application logic
An Apex trigger creates an Order c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal method for a developer to troubleshoot this?
A . Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
B . Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.
C . Add system.debug() statements to the code and use the Developer Console logs to trace the code.
D . Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.
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?
A . Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period. B . Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing.
C . Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing. D . Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.
A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the callerâ€™s account number before proceeding with the rest of their call script.
Following best practices, what should a developer use to meet this requirement? A . Apex Trigger
B . Process Builder C . Flow Builder
D . Approvals
Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer.
The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and stored back in Salesforce.
What is the optimal solution?
A . A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce B . An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing back in Salesforce
C . A Process Builder process and Outbound Message to fetch the pricing upon save and store the pricing in Salesforce D . An ETL tool to process batches of newly saved Orders every few minutes to store the pricing back in Salesforce
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?
A . Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading. B . Use a List Custom Setting to disable the Trigger for the user who does the data loading.
C . Add the Profile Id of the user who does the data loading to the Trigger so the Trigger wonâ€™t fire for this user. D . Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.
Which method of integration is optimal? A . REST API
B . Apex SOAP Web Service C . Soap API
D . Apex REST Web Service
A developer wishes to improve runtime performance of Apex calls by caching results on the client. What is the best way to implement this?
A . Decorate the server-side method with @AuraEnabled(cacheable=true).
B . Set a cookie in the browser for use upon return to the page.
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?
A . Expose it in the markup using the implements and access attributes.
B . Delete the component, metadata, and Apex controller and recreate them. C . Refresh the sandbox and upgrade it to the latest API version.
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? A . Does the screen need to be rendered as a PDF?
D . Will the screen be accessed via a mobile app?
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.
What can a developer to do address the issue?
A . Move the prerequisite reference data setup to a TestDataFactory and call that from each test method. B . Move the prerequisite reference data setup to a @testSetup method in the test class.
C . Move the prerequisite reference data setup to a static method in the test class and call that from each test method. D . Move the prerequisite reference data setup to the constructor for the test class.
An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Accountâ€™s address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contactâ€™s state.
Consider the following: A mass update of 200 Account recordsâ€™ addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?
A . The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.
B . There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.
C . There will be no error, since the limit on the number of records processed by DML statements is 50,000.
D . The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.
Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs.
What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component? A . Apex Batch job that counts the number of Opportunity records
B . SUM() SOQL aggregate query on the Opportunity object
C . SOQL for loop that counts the number of Opportunities records D . COUNT() SOQL aggregate query on the Opportunity object
A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message? A . <apex:message for="info"/>
B . <apex:facet name="messages" />
C . <apex:pageMessage severity="info" /> D . <apex:pageMessages />
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?
A . Verify the user has permissions passing a user into System.runAs().
B . Call the Apex class method from a testMethod instead of the testSetup method. C . Add @testVisible to the method in the class the developer is testing.
D . Use system.assert() in testSetup to verify the values are being returned.