Salesforce PDII Exam Preparation Guide and PDF Download
Verified & Correct PDII Practice Test Reliable Source Dec 06, 2023 Updated
NEW QUESTION # 17
Choose the correct definition for <apex:pageMessage>
- A. No formatting; displays all errors on a page
- B. A single message, without formatting, that can be associated with a specific component on the page
- C. Standard Salesforce formatting, shows all errors that occur on page. Can add more messages through the
"ApexPages.addMessage" function - D. Standard Salesforce formatting, throws a specific message on a page
Answer: C
NEW QUESTION # 18
A developer wrote a class named AccountHistoryManager that relies on field history tracking. The class has a static method called getAccountHistory that takes in an account as a parameter and returns a list of associated AccountHistory object records.
The following test fails:
What should be done to make this test pass?
- A. The test method should be deleted since this code cannot be tested.
- B. Create AccoumHistory records manually in the test setup and write a query to get them.
- C. Use Test.isRunningTest () in getAccountHistory () to conditionally return fake Account History records.
- D. Use @isTest(SeeAllData-true) to see historical data from the org and query for AccountHistory records.
Answer: C
NEW QUESTION # 19
As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles error* using toast messages. When the development is complete, all the components are added to the same Lightning page.
During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the component Which two techniques should the developer Implement to improve the user experience?
Choose 2 answers
- A. Use a Lightning web component to aggregate and display all errors.
- B. Use the window. Alert () method to display the error messages.
- C. Use a <template> tag to display in-place error messages.
- D. Use public properties on each component to display the error messages.
Answer: C,D
NEW QUESTION # 20
A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org. Users report that they receive a "Maximum view state size limit" error message under certain conditions.
According to Visualforce best practice, which three actions should the developer take to reduce the view state?
(Choose three.)
- A. Use filters and pagination to reduce the amount of data
- B. Use the private keyword in the controller for variables
- C. Use the transient keyword in the Apex controller for variables that do not maintain state
- D. Refine any SOQL queries to return only data relevant to the page
- E. Use the final keyword in the controller for variables that will not change
Answer: A,D,E
NEW QUESTION # 21
The REST API___________.
- A. Is used to create, retrieve, update or delete records, such as accounts, leads, and custom objects, and allows you to maintain passwords, perform searches, and much more
- B. Is based on REST principles and is optimized for loading or deleting large sets of data. You can use it
to query, queryAII, insert, update, upsert, or delete many records asynchronously by submitting batches - C. Is used to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment
- D. Provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it's an excellent choice of technology for use with mobile applications and web projects
Answer: D
NEW QUESTION # 22
A developer created a Lightning web component that uses a lightning-record-edit-form t collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.
complain that they only see one error message at a time about their input when trying to save a Lead record.
What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?
- A. Apex trigger
- B. External JavaScript library
- C. Try/catch/finally block
- D. Validation rules
Answer: B
NEW QUESTION # 23
A company's support process dictates that any time a case is closed with a status of 'Could not fix,' an Engineering Review custom object record should be created and populated with information from the case, the contact and any of the products associated with the case.
What Is the correct way to automate this us ng an Apex trigger?
- A. A before update trigger or Case that creates the Engineering Review record and Inserts It
- B. An after upsert trigger on Case that creates the
Engineering Review record and inserts it - C. An alter update trigger on Case that creates the
Engineering Review record and inserts it - D. A before upsert trigger or Case that creates the Engineering Review record and inserts it
Answer: C
NEW QUESTION # 24
When testing batch classes, what must a developer do? (Choose two.)
- A. Call the class* "execute" method
- B. Use seeAIIData=true
- C. Encapsulate code in Test.startTestQ and Test.stopTestQ
- D. Limit the amount of records you test to < 200
Answer: C,D
Explanation:
Explanation
If you use "seeAIIData=true," you are a bad person
NEW QUESTION # 25
In an organization that has multi-currency enabled, a developer is tasked with building a Lighting Component that displays the top ten Opportunities most recently access by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.
What is the most effective approach to ensure values displayed respect the users locale settings?
- A. Use the FORMAT() function in the SOQL query.
- B. Use a wrapper class to format the values retrieved via SOQL.
- C. Use the FOR VIEW clause in the SOQL Query.
- D. Use REGEX expressions to format the values retrieved via SOQL.
Answer: A
NEW QUESTION # 26
Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users.
What are two alternatives to implement the integration and protect against malicious calls to Heroku app's endpoint? Choose 2 answers
- A. Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key. so that the Heroku app can authenticate requests and store the resized images in Salesforce.
- B. Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce.
- C. Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce.
- D. Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data; therefore the Heroku app can automatically reply back to the callout with the resized images in Salesforce.
Answer: B,C
NEW QUESTION # 27
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.aasert () in testSetup to verify the values are being returned.
- B. Add @testvisibie to the method in the class the developer is testing.
- C. Verify the user has permissions passing a user into system.runAs ().
- D. Call the Apex class method from a testMethod instead of the testsetup method.
Answer: D
NEW QUESTION # 28
A developer writes a lightning web component that displays a dropdown list of all custom objects in the org from which a user will select Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include in the response?
- A. Check the getObjectType () value for Custom' or 'Standard' on the sObject describe result.
- B. Use the getCustomObject ( ) method from the Schema class.
- C. Check the isCustom ( ) value on the sObject describe result.
- D. Import the list of all custom objects from @salesforce/schema.
Answer: C
NEW QUESTION # 29
A company has a custom object, Order__c, that has a custom picklist field, Status__c, with values of 'New', 'In Progress', or 'Fulfilled' and a lookup field, Contact__c, to Contact.
Which SOQL query will return a unique list of all the Contact records that have no 'Fulfilled' Orders?
SELECT Id FROM Contact WHERE Id NOT IN (SELECT Id FROM Order__c WHERE
- A. Status__c = 'Fulfilled')
- B. SELECT Id FROM Contact WHERE Id NOT IN (SELECT Contact__c FROM Order__c WHERE
- C. Status__c = 'Fulfilled')
SELECT Contact__c FROM Order__c WHERE Id NOT IN (SELECT Id FROM Order__c Where - D. Status__c = 'Fulfilled')
SELECT Contact__c FROM Order__c WHERE Status__c <> 'Fulfilled'
Answer: A
NEW QUESTION # 30 
The test method above tests in Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?
- A. Add Test.startTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code
- B. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger
- C. Add Test.startTest() before and Test.stopTest() after both Line 7 of the code and Line 20 of the code
- D. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced
Answer: C
NEW QUESTION # 31
Invokable methods accept sObjects as parameters
- A. True
- B. False
Answer: B
NEW QUESTION # 32
Which type of controller is best suited when you want to add custom functionality to a standard controller page, or when you want reusable functionality throughout pages?
- A. Controller Extensions
- B. Standard Controller
- C. Standard List/Set Controller
- D. Custom Controller
Answer: A
NEW QUESTION # 33
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. Call the Apex class method from a testMethod instead of the testSetup method.
- B. Use system.assert() in testSetup to verify the values are being returned.
- C. Add @testVisible to the method in the class the developer is testing.
- D. Verify the user has permissions passing a user into System.runAs().
Answer: A
NEW QUESTION # 34
A software company uses a custom object Defect_c, to track defects in their software, Defect__c has organisation-wide defaults set to private Each Dafect__c has a related list of Reviewer_c records, each with a lookup field to User that is used to indicate that the User will review the Defect_c.
What should be used to give the User on the Reviewer_c record read only access to the Defect_c record on the Reviewer_c record?
- A. Criteria based sharing
- B. View All on Defect_c
- C. Apex managed sharing
- D. lightning web component
Answer: B
NEW QUESTION # 35
......
To prepare for the Salesforce PDII certification exam, candidates must have a deep understanding of the Salesforce platform and its various features and functionalities. They must also possess strong programming skills and be proficient in Apex, Visualforce, and Salesforce Lightning development. Candidates can also benefit from taking online courses or attending in-person training sessions to gain a better understanding of the exam's content and format. Ultimately, the Salesforce PDII certification offers a unique opportunity for developers to demonstrate their skills and expertise in Salesforce development and advance their careers in this fast-growing industry.
Pass Salesforce PDII exam Dumps 100 Pass Guarantee With Latest Demo: https://actualtests.realvalidexam.com/PDII-real-exam-dumps.html
