[Dec 21, 2023] Pass Salesforce PDII Exam Info and Free Practice Test [Q95-Q119]

Share

[Dec 21, 2023] Pass Salesforce PDII Exam Info and Free Practice Test

PDII Exam Dumps PDF Updated Dump from TorrentExam Guaranteed Success


To prepare for the PDII exam, it is recommended that you have at least two years of experience developing custom applications on the Salesforce platform. You should also have a deep understanding of Apex, Visualforce, and the Salesforce API. Salesforce offers a range of resources to help you prepare for the PDII exam, including online courses, study guides, and practice exams. It is important to note that the PDII exam is challenging, and it requires a significant amount of preparation and study.

 

NEW QUESTION # 95
Assuming the CreateOneAccount class creates one account and implements the Queuetable interface, which syntax tests the Apex code?
A)

B)

C)

D)

  • A. Option C
  • B. Option A
  • C. Option B
  • D. Option D

Answer: C


NEW QUESTION # 96
Which statement is considered a best practice for writing bulk safe Apex Triggers?

  • A. Perform all DML operations from within a Future Method.
  • B. Instead of DML statements, use the Database methods with allOrNone set to False.
  • C. Add records to collections and perform DML operations against these collections.
  • D. Add LIMIT 50000 to every SOQL statement

Answer: C


NEW QUESTION # 97
A developer has refactored an application and renamed an Apex class in a sandbox and now needs to deploy the changes to production. How can this be accomplished? Choose 2 answers

  • A. Deploy the new Apex class, and then log in to the production environment and manually delete the class.
  • B. Deploy the new Apex class with the Force.com Migration Tool and set the old name in destructiveChanges.xml.
  • C. Use the Force.com IDE to delete the old Apex class from the project and deploy the changes to production.
  • D. Use a changeset to both delete the old Apex class and deploy the new Apex class to production.

Answer: B,C


NEW QUESTION # 98
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. Call the translate method on each record in the SOQL result list.
  • B. Use tolabel ducts__c) in the fields list of the SOQL query.
  • C. Use the Locale clause in the SOQL query.
  • D. Set the locale on each record in the SOQL result list.

Answer: B

Explanation:
To ensure the value of Products__c is in the current user's language, the developer should use toLabel(Products__c) in the fields list of the SOQL query. The toLabel() function converts the picklist values in the query result to the user's language, if the translation workbench is enabled and the values are translated. This way, the developer can display the translated values of the custom multi-select picklist field in the Apex method. Setting the locale on each record in the SOQL result list would not work, as the locale is a user attribute, not a record attribute, and it cannot be changed by Apex code. Calling the translate method on each record in the SOQL result list would not work, as there is no such method in Apex. Using the Locale clause in the SOQL query would not work, as there is no such clause in SOQL. Reference: [Using the toLabel() Function], [Locale Class]


NEW QUESTION # 99
An org has a 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 trigger on Account that calls the Contact trigger to normalize the address
  • B. Apex triggers on Contact and Account that call a helper class 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

Answer: D


NEW QUESTION # 100
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. Call support for help with the target endpoint, as it is likely an external code error.
  • B. Use test.IsRunningTest() before making the callout to bypass it in test execution.
  • C. Set seeAIIData to "true" at the top of the test class, since the code does not fail in practice.
  • D. Rewrite the business logic and test classes with @TestVisible set on the callout.

Answer: B


NEW QUESTION # 101
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 Apex Scheduler to schedule each process.
  • B. Use Limits class to stop entire process once governor limits are reached.
  • C. Use multiple 3zutuze methods for each process and callout.
  • D. Use Queueable Apex to chain the jobs to run sequentially.

Answer: D


NEW QUESTION # 102
Refer to the component code and requirements below:

  • A.
  • B.
  • C.
  • D.

Answer: C


NEW QUESTION # 103
A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?

  • A. Create an Outbound Message that contains the session ID and send it to the OMS.
  • B. Create an Apex trigger and make a callout to the OMS from the trigger.
  • C. Generate the Partner WSDL and use it to make a callout to the OMS.
  • D. Generate the Enterprise WSDL and use it to make a callout to the OMS.

Answer: D


NEW QUESTION # 104
When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue?

  • A. Use the Continuation=true attribute in the Apex method.
  • B. Ensure the OWD for the Opportunity object is Public.
  • C. Use the Cacheable=true attribute in the Apex method,
  • D. Edit the code to use the w. cut sharing keyword in the Apex class.

Answer: C

Explanation:
The Cacheable=true attribute is used to indicate that the Apex method can be cached and reused on the client side, such as in a Lightning web component. This attribute enables the method to be called imperatively or via @wire in the component, and improves the performance and user experience of the component. Without this attribute, the Apex method can only be called imperatively, and will not work with @wire, which is used to get data from the server and update the component automatically. This can cause an error when the component is rendered, such as "Error retrieving data". Reference: [Call Apex Methods], [Imperative Apex]


NEW QUESTION # 105
A developer created a Lightning web component that uses a lightning-record-edit-form to 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.
What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

  • A. External JavaScript library
  • B. Validation rules
  • C. Try/catch/finally block
  • D. Apex trigger

Answer: A

Explanation:
The recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention is to use an external JavaScript library. An external JavaScript library is a collection of reusable code that can provide additional functionality and features to the Lightning web component. The developer can use an external JavaScript library that supports form validation, such as jQuery Validation or Parsley.js, and import it into the Lightning web component. The developer can then use the library's methods and options to define the validation rules and messages for each field, and to display the errors on the component. Using a try/catch/finally block will not help, as it is used to handle exceptions and errors in the code, but it does not perform validations on the fields or display error messages. Using validation rules will not help, as they are used to enforce data quality and integrity on the server side, but they do not perform validations on the client side or display error messages on the component. Using an Apex trigger will not help, as it is used to execute logic before or after a record is inserted, updated, deleted, or undeleted, but it does not perform validations on the client side or display error messages on the component. Reference: [Use Third-Party JavaScript Libraries], [Lightning Web Components Developer Guide]


NEW QUESTION # 106
Which code statement includes an Apex method named updateAccount in the class AccountController for use in a Lightning web component?

  • A. Import updateAccounts from @salesforceapexAccountControllerupdateAccounts';
  • B. Import updateAccounts from AccountController';
  • C. Import updateAccounts from AccountControllerupdateAccount';
  • D. Import updateAccounts from @salesforceapex AccountController';

Answer: D


NEW QUESTION # 107
A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call. Which feature should be used to implement these requirements?

  • A. @future
  • B. Process Builder
  • C. Queueable
  • D. workflow

Answer: B


NEW QUESTION # 108
A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method, getRecentContacts, returns a list of Contacts and will be wired to a property in the component.

Which two lines must change in the above ode to make the Apex method able to be wired?
Choose 2 answers

  • A. Add public to line 04.
  • B. Remove private from line 09.
  • C. Add AuraEnanled(cacheabletrue) to the line 08
  • D. Add @AuraEnabled (cacheabletrue) to line 03.

Answer: A,D


NEW QUESTION # 109
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. An alter update trigger on Case that creates the
    Engineering Review record and inserts it
  • B. A before upsert trigger or Case that creates the Engineering Review record and inserts it
  • C. An after upsert trigger on Case that creates the
    Engineering Review record and inserts it
  • D. A before update trigger or Case that creates the Engineering Review record and Inserts It

Answer: A


NEW QUESTION # 110
ABC Company has an Apex process that makes multiple extensive database operation and web service callouts. The database processes and web services can take a length 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 Limits class to stop entire process once governor limits are reached.
  • B. Use multiple @future methods for each process and callout.
  • C. Use Queueable Apex to chain the jobs to run sequentially.
  • D. Use Apex Scheduler to scheduled each process.

Answer: C


NEW QUESTION # 111
Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates? Choose 3 answers

  • A. Two Lightning Components leveraging Application Events
  • B. A single visualforce Page leveraging Platform Events
  • C. Two Lightning Components leveraging Platform Events
  • D. Two Visualforce Page Components leveraging Application Events

Answer: B,D


NEW QUESTION # 112
REST uses __________.

  • A. The HTTPResponse class
  • B. All of the above
  • C. The HTTPRequest class
  • D. The HTTP class

Answer: B

Explanation:
CalloutException happens if an error occurs Classes begin with @RestResource(urlMapping='/yourUrl'), and methods can have annotations such as @HttpGet, @HttpPost, etc


NEW QUESTION # 113
A developer created 2 class that implements the Queueable Interface, as follows:

As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers

  • A. Implement Test. isRunningTest() to prevent chaining jobs during test execution.
  • B. Ensure the running user of the test class has, at I the View All permission on the Order object.
  • C. Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.
  • D. Enclose System.enqueueJob(new OrderQueueableJob ()] within Tess. and Test .stopTest (1.

Answer: B,D


NEW QUESTION # 114
Given the following containment hierarchy:

What is the correct way to communicate the new value of a property named ''passthrough'' to my-parent component if the property is defined within my-child-component?
A)

B)

C)

D)

  • A. Option C
  • B. Option A
  • C. Option B
  • D. Option D

Answer: C


NEW QUESTION # 115
A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.
What might be causing the failed assertion?

  • A. The test class is not using System.runAs() to run tests as a Salesforce administrator
  • B. The test class has not re-queried the Account record after updating the Opportunity
  • C. The test class has not implemented seeAllData=true in the test method
  • D. The test class has not defined an Account owner when inserting the test data

Answer: B

Explanation:
Explanation/Reference:


NEW QUESTION # 116
A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records. How should the developer handle the recursive trigger?

  • A. Use a static variable to prevent the trigger from executing more than once.
  • B. Use a global variable to prevent the trigger from executing more than once.
  • C. Deactivate the workflow rule to prevent the field update from executing.
  • D. Deactivate the trigger and move the logic into a Process or Flow.

Answer: A


NEW QUESTION # 117
Which of the following exceptions cannot be caught and will force an error? (Choose three.)

  • A. DMLException
  • B. ListException
  • C. LimitException
  • D. License exceptions
  • E. SObjectExceptions
  • F. AssertException

Answer: C,D,F

Explanation:
/Reference:
SObjectException occurs when accessing a field not queried, or you try to change a field during the wrong dml statement (i.e. an edit-only field being set on insert) Custom exceptions must extend the "Exception" class


NEW QUESTION # 118
What is the transaction limit on the number of "sendEmail" method calls?

  • A. 0
  • B. There is no limit
  • C. 1
  • D. 2
  • E. 3

Answer: A

Explanation:
/Reference:
The reserveEmailCapacity methods let you declare how many emails you want to send prior to actually sending, allowing you to handle limit errors prematurely


NEW QUESTION # 119
......

Pass Your Salesforce Exam with PDII Exam Dumps: https://dumpscertify.torrentexam.com/PDII-exam-latest-torrent.html