PDII Practice Test Questions

193 Questions


Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer. Recently a record-triggered flow was added so that whenever an Account is marked as a Customer, a "Customer Since’ date field is updated with today's date. Since the addition of the flow, two Account Plan records are created whenever the Account is marked as a Customer. What might cause this to happen?


A. The Apex trigger does not use a static variable to ensure it only fires once.


B. The flow is configured to use an "Update Records’ element.


C. The Apex trigger is not bulk safe and calls insert inside of a for loop.


D. The flow is configured to evaluate when a record is created and every time it is edited.





D.
  The flow is configured to evaluate when a record is created and every time it is edited.

A developer is building a Lightning web component that searches for Contacts. The component must communicate the search results to other unrelated Lightning web components, that are in different DOM trees, when the search completes. What should the developer do to implement the communication?


A. Fire an application event.


B. Publish an event on an event channel.


C. Fire a custom component event.


D. Publish a message on a message channel.





D.
  Publish a message on a message channel.

Universal Containers (LIC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site. What should the developer use to ensure the site is multilingual?


A. Use custom labels to ensure custom messages are translated properly.


B. Use custom settings to ensure custom messages are translated properly.


C. Use custom objects to translate custom picklist values.


D. Use custom metadata to translate custom picklist values.





A.
  Use custom labels to ensure custom messages are translated properly.

Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Product__c, on the Account object that allows sales reps to specify which of UC’s products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Product_c field. What should the developer do to ensure the value of Products__c is in the current user's language?


A. Use tolabel ducts__c) in the fields list of the SOQL query.


B. Set the locale on each record in the SOQL result list.


C. Call the translate method on each record in the SOQL result list.


D. Use the Locale clause in the SOQL query.





A.
  Use tolabel ducts__c) in the fields list of the SOQL query.

The use of the transient keyword in Visualforce page controllers helps with which common performance issue?


A. Reduces load times


B. Improves page transfers


C. Reduces view state


D. Improves query performance





C.
  Reduces view state

A Salesforce developer is hired by a multi-national company to build a custom Lightning application that shows employees their employment benefits and earned commissions over time. The application must acknowledge and respect the user's locale context for dates, times, numbers, currency, and currency symbols. When using Aura components, which approach should the developer implement to ensure the Lightning application complies with the user's locale?


A. Use the $User global variable to retrieve the user preferences.


B. Use the $Label global value provider.


C. Use the $Lacale value provider to retrieve the user preferences.


D. Create a Hierarchical custom setting to store user preferences.





C.
  Use the $Lacale value provider to retrieve the user preferences.

A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time. There is a new requirement to also display high value opportunities in a Lightning web component. Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high value opportunities from being repeated in more than one place? Choose 2 answers


A. Call the trigger from the Lightning web component.


B. Create a helper class that fetches the high value opportunities,


C. Leave the business logic code inside the trigger for efficiency.


D. Use custom metadata to hold the high value amount.





B.
  Create a helper class that fetches the high value opportunities,

D.
  Use custom metadata to hold the high value amount.

An org has 2 requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved. What is the optimal way to implement this?


A. Apex triggers on Contact and Account that call a helper class to normalize the address


B. Apex trigger on Account that calls the Contact trigger to normalize the address


C. Apex triggers on Contact and Account that normalize the address


D. Apex trigger on Contact that calls the Account trigger to normalize the address





C.
  Apex triggers on Contact and Account that normalize the address

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.

Business rules require a Contact ta always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?


A. Use setSaverpoint (1) and rollback() with a try-catch block.


B. Use the Database. Insect method with a11orNone SEL LO alee,


C. Use the Database. Delete method if the Contact insertion fails.


D. Disable validation rules on Contacts and set default values with a trigger.





A.
  Use setSaverpoint (1) and rollback() with a try-catch block.

A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail. What is the optimal way for a developer to fix the issue?


A. Add the required field to the data setup for all of the unit tests.


B. Add a before insert trigger on Account to set the value of the required field,


C. Change the required field to be a validation rule that excludes the System Administrator profile.


D. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.





D.
  Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

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. Use system.assert() in testSetup to verify the values are being returned.


B. Verify the user has permissions passing a user into System,.runds().


C. Call the Apex class method from a testsetup Instead of the testsetup methed.


D. Add @testvisible to the method in the class the developer is testing.





C.
  Call the Apex class method from a testsetup Instead of the testsetup methed.


Page 7 out of 17 Pages
Previous