Certified Platform Developer II

Here you have the best Salesforce Certified Platform Developer II practice exam questions

  • You have 257 total questions to study from
  • Each page has 5 questions, making a total of 52 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 19, 2024
Question 1 of 257

A Visualforce page loads slowly due to the large amount of data it displays.

Which strategy can a developer use to improve the performance?

    Correct Answer: C

    To improve the performance of a Visualforce page that loads slowly due to a large amount of data, a developer can use lazy loading to load the data on demand, instead of in the controller's constructor. This approach ensures that the page only loads necessary data initially, thereby reducing the initial load time and improving performance.

Question 2 of 257

Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments' containers, based on a junction object that relates the Contact to the various Account records that represent the departments.

Which solution solves these requirements?

    Correct Answer: D

    To satisfy the requirement that specific community users within the same Account hierarchy be able to see several departments' containers based on a junction object that relates the Contact to various Account records, an Apex Trigger is the most appropriate solution. This is because an Apex Trigger can create Apex Managed Sharing records, which allows for programmatic sharing of records based on complex relationships that can't be managed by standard sharing rules or configurations. This approach provides the flexibility needed to share records dynamically based on the junction object's relationships.

Question 3 of 257

Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth.

What would allow Universal Containers to switch vendors without updating the code to handle authentication?

    Correct Answer: D

    Named Credentials in Salesforce allow you to specify the URL of a callout endpoint and its authentication parameters. By using Named Credentials, you can abstract the details of the authentication process. This means that if Universal Containers switches from a vendor using basic password authentication to one using OAuth, the underlying code does not need to be modified to handle the different types of authentication. Instead, only the Named Credential configuration needs to be updated, making it the most flexible and maintainable solution for switching vendors without updating code.

Question 4 of 257

A company has a Lightning Page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.

What can a developer use to analyze and diagnose the problem in the Lightning Page?

    Correct Answer: D

    To analyze and diagnose issues related to cached reference data in a Lightning Page, a developer should use the Salesforce Lightning Inspector Storage Tab. This tab shows the client-side storage for Lightning applications, which includes actions marked as storable. By examining this storage, the developer can determine whether the most current reference data is being correctly cached and retrieved.

Question 5 of 257

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error.

What should be done to address the problem?

    Correct Answer: C

    The error 'You have uncommitted work pending. Please commit or rollback before calling out' occurs because a callout cannot be made after DML operations within a single transaction. By changing the CalloutUtil.makeRestCallout to an @future method, the callout will be executed in a separate asynchronous transaction, thereby resolving the issue. Future methods allow for callouts to be performed after the current transaction has been committed. This is necessary in order to avoid the pending uncommitted work error.