PDII Exam Questions

Total 85 Questions

Last Updated Exam : 22-Nov-2024

Universal Containers develops a Salesforce application that requires frequent interaction with an external REST API. To avoid duplicating code and improve maintainability, how should they implement the API integration for code reuse?


A.

Use a separate Apex class for each API endpoint to encapsulate the integration logic.


B.

Include the API integration code directly in each Apex class that requires it.


C.

Create a reusable Apex class for the API integration and invoke it from the relevant Apex classes.


D. Store the API integration code as a static resource and reference it in each Apex class.





C.
  
Create a reusable Apex class for the API integration and invoke it from the relevant Apex classes.



Universal Containers uses Salesforce to track orders in an order__c object. The order = object has private organization-wide defaults. The order = object has a custom field, Quality_Controller_c, that is a Lookup to User and is used to indicate that the specified User is performing quality control on the order_ co. What should be used to automatically give read only access to the User set in the Quality_Controller field?


A.

Record ownership


B.

Criteria-based sharing


C.

Apex managed sharing


D. User managed sharing





D.
  User managed sharing

A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints. The information needs to be displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process. How should a developer implement the callouts?


A.

An HTTP REST callout for the billing callout and a Continuation for the tax callout


B.

A Continuation for both the billing callout and the tax callout


C.

An HTTP REST callout for both the billing callout and the tax callout


D. A Continuation for the billing callout and an HTTP REST callout for the tax callout





B.
  
A Continuation for both the billing callout and the tax callout



A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially. How should the developer write this Apex code without running into governor limits and system limitations?


A. Use Queueable Apex to chain the jobs to run sequentially.


B. Use Apex Scheduler to schedule each process.


C. Use multiple 3zutuze methods for each process and callout.


D. Use Limits class to stop entire process once governor limits are reached.





A.
  Use Queueable Apex to chain the jobs to run sequentially.

A developer is building a complex commission calculation engine in Apex that is called from an Opportunity trigger. During QA it was reported that the calculations are incorrect. The developer has representative test data and passing test methods in their developer sandbox. Which three tools or techniques could the developer use to execute the code and pause it at key lines to visually inspect values of various Apex variables? (Choose 3 answers)


A. Apex Interactive Debugger


B. Workbench


C. Developer Console


D. Breakpoints


E. Apex Replay Debugger





A.
  Apex Interactive Debugger

C.
  Developer Console

E.
  Apex Replay Debugger




Explanation:

To debug and troubleshoot the commission calculation engine, a developer can use several tools provided by Salesforce to inspect and pause the execution of Apex code.

Apex Interactive Debugger: It allows real-time debugging of Apex code execution. With this tool, a developer can set breakpoints, step through code, inspect variables, and evaluate expressions.

Developer Console: Although the Developer Console does not allow interactive debugging, it does provide the ability to view logs that capture the execution of code. Debug logs can be inspected to understand the flow of execution and values of variables at different points in time.

Apex Replay Debugger: This tool is part of Salesforce Extensions for Visual Studio Code. It allows a developer to replay a debug log as if they are stepping through the code line by line, which can be very useful to inspect the state of variables at specific points in the execution.

A developer is tasked with creating a Lightning web component that is responsive on various devices, Which two components should help accomplish this goal? (Choose 2 answers)


A. lightning-navigation


B. Lightning-input-location


C. Lightning-layout


D. lightning-layout—-item





C.
  Lightning-layout

D.
  lightning-layout—-item

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?


A. Use addError() on the parent record if an error occurs on the child record.


B. Set a database savepoint to rollback if there are errors.


C. Use Database.insert() and set the allOrNone parameter to true.


D. Delete the parent record in the catch statement when an error occurs on the child record DML operation.





B.
  Set a database savepoint to rollback if there are errors.

A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products.

A developer received these requirements:

* Whenever a product is created or updated in the PIM, a product must be created or updated as a Product? record in Salesforce and a PricebookEntry record must be created or updated automatically by Salesforce.

= The PricebookEntry should be created in a Priceboek2 that is specified in a custom setting.

What should the developer use to satisfy these requirements?


A. Event Monitoring


B. Invocable Action


C. SObject Tree REST


D. Custom Apex REST





D.
  Custom Apex REST


Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page. What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?


A. use System. profiles=() to test as a sales rep and a community user.


B. use System. profiles() to test as an administrator and a community user.


C. use System. profiles1h=() to test as a sales rep and a community user.


D. use System. runsAs () to test as an administrator and a community user.





C.
  use System. profiles1h=() to test as a sales rep and a community user.


A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format. Which is the optimal method to implement this in Salesforce?


A. Apex REST web service


B. Apex SOAP web service


C. Apex SOAP callout


D. Apex REST callout





A.
  Apex REST web service



Page 1 out of 9 Pages