Practice Free PDII Exam Online Questions
Consider the Apex class below that defines a RemoteAction used on a Visualforce search page.
Which code snippet will assert that the remote action returned the correct Account?
A)
B)
- A . Option A
- B . Option B
Refer to the markup below:
A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?
A)
B)
C)
D)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
Which two best practices should the developer Implement to optimize this code?
Choose 2 answers
- A . Use a collection for the DML statement.
- B . Query the Pricing_structure__c records outside of the loop.
- C . Change the trigger context to after update, after insert.
- D . Remove the DML statement.
An org records customer order information In a custom object, Orcer__c, that has fields for the shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a fiat percentage rate associated with the region of the shipping address.
What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are
needed for the calculation to work?
- A . Custom object
- B . Custom metadata type
- C . Custom list setting
- D . Custom hierarchy setting
Universal Containers implements a private sharing model for the Convention_Attendence_c custom object. As part of a new quality assurance effort, the company created an Event___Reviewer__c user lookup field on the object. Management wants the event reviewer to automatically gain Read/write access to every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?
- A . Create an After Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.
- B . Create a Before Insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.
- C . Create a criteria-based sharing rule on the Convention Attendee custom object to share the records the a group of Event Reviewers.
- D . Create criteria-based sharing rules on the Convention Attendee custom object to share the records with the Event Reviewers.
A developer has working business logic code, but sees the following error in the test class:
You have uncommitted work pending. Please commit or rollback before calling out.
What is a possible solution?
- A . Rewrite the business logic and test classes with ©TestVisible set on the callout.
- B . Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice.
- C . Call support for help with the target endpoint, as it is likely an external code error.
- D . Use test.IsRunningTest() before making the callout to bypass it in test execution.
A company uses Opportunism to track sales to their customers and their org has millions of Opportunities. They want to begging to track revenue over time through a related Revenue object.
As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic. They estimate that roughly 100,000 Opportunities will have revenue records and populated.
What is the optimal way to automate this?
- A . Use System.enqueueJob>() to Invoke a Queueable class.
- B . Use System.scheduleJob() to schedule a Database.Scheduleable class.
- C . Use Database.executeBatch() to invoke a Queueable dass.
- D . Use Database.txtcuteBatch() to invoke a Database.Batchable class.
A developer wrote the following method to find all the test accounts in the org:
What should be used to fix this falling test?
- A . Test. loaddata to set up expected data
- B . Test. fixedSearchResults ( ) method to set up expected data
- C . @isTest (See AllData=true) to access org data for the test
- D . @testSetup method to set up expected data
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.
What should be done to address the problem?
- A . Move the CalloutUtil.makeRestCallout method call below the catch block.
- B . Remove the Database.setSavepoint and Database.rollback.
- C . Change the CalloutUtil.makeRastCallout to an @InvocableMethed method.
- D . Change the CalloutUtil.makeRestCallout to an @future method.
A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.
When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?
- A . Add an <apex: actionFunction> within the <apex : selectOptions>.
- B . Add an <apex: actionFunction> within the <apex: select List >.
- C . Add an <apex: actionSupport> within the <apex:selectList>.
- D . Add an <apex: actionSupport> within the <apex: selectOptions>.