[Apr-2023] Practice Salesforce PDI exam. Online Exam Practice Tests with detailed explanations! Pass PDI with confidence! [Q40-Q57]

Share

Practice Salesforce PDI PDI exam. Online Exam Practice Tests with detailed explanations! Pass PDI with confidence!

PDI - Platform Developer I (PDI) Practice Tests 2023 | Lead1Pass

NEW QUESTION 40
When would a developer use a custom controller instead of a controller extension? Choose 2 answers:

  • A. When a Visualforce page does not reference a single primary object.
  • B. When a Visualforce page needs to add new actions to a standard controller.
  • C. When a Visualforce page should not enforce permissions or field-level security.
  • D. When a Visualforce page needs to replace the functionality of a standard controller.

Answer: A,C

 

NEW QUESTION 41
What are three ways for a developer to execute tests in an org? Choose 3.

  • A. Metadata API.
  • B. Setup Menu
  • C. Bulk API
  • D. Salesforce DX
  • E. Tooling API

Answer: B,D,E

Explanation:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_testing.htm https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apextestsuite.htm

 

NEW QUESTION 42
When the value of a field of an account record is updated, which method will update the value of a custom field opportunity? Choose 2 answers.

  • A. A workflow rule on the Account object
  • B. A cross-object formula field on the Account object
  • C. A process builder on the Account object
  • D. An Apex trigger on the Account object.

Answer: C,D

 

NEW QUESTION 43
A developer has the following requirements:
Calculate the total amount on an Order.
Calculate the line amount for each Line Item based on quantity selected and price.
Move Line Items to a different Order if a Line Item is not stock.
Which relationship implementation supports these requirements?

  • A. Order has a Lookup field to Line Item and there can be many Line Items per Order.
  • B. Line Items has a Master-Detail field to Order and the Master can be re-parented.
  • C. Line Item has a Lookup field to Order and there can be many Line Items per Order
  • D. Order has a Master-Detail field to Line Item and there can be many Line Items per Order.

Answer: D

 

NEW QUESTION 44
A developer needs to provide a Visualforce page that lets users enter Product-specific details during a Sales cycle. How can this be accomplished? (Choose 2)

  • A. Create a new Visualforce page and an Apex controller to provide Product data entry.
  • B. Download an Unmanaged Package from the AppExchange that provides a custom Visualforce page to modify.
  • C. Download a Managed Package from the AppExhange that provides a custom Visualforce page to modify.
  • D. Copy the standard page and then make a new Visualforce page for Product data entry.

Answer: A,B

 

NEW QUESTION 45
Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

  • A. The @testSetup annotation cannot be used when the @isTest(SeeAllData=True) annotation is used.
  • B. Test data is inserted once for all test methods in a class.
  • C. Records created in the @testSetup method cannot be updates in individual test methods.
  • D. The @testSetup method is automatically executed before each test method in the test class is executed.

Answer: D

 

NEW QUESTION 46
Candidates are reviewed by four separate reviewers and their comments and scores which range from 1 (lowest) to 5 (highest) are stored on a review record that is a detail record for a candidate what is the best way to indicate that a combined review score of 15 of better is required to recommend that the candidate come in for an interview?

  • A. Use a rollup summary field to calculates the sum of the review scores, and store this in a total score field on the candidate
  • B. Use visual workflow to set a recommended field on the candidate whenever the cumulative review score is 15 or better
  • C. Use a validation rule on a total score field on the candidate record that prevents a recommended field from being true if the total score is less than 15
  • D. Use a workflow rule to calculate the sum of the review scores and send an email to the hiring manager when the total is 15 or better

Answer: D

 

NEW QUESTION 47
A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of new Apex helper class. Change Set deployment to production fails with the test coverage warning:
"Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required" What should the developer do to successfully deploy the new Apex trigger and helper class?

  • A. Run the tests using the 'Run All Tests' method.
  • B. Increase the test class coverage on the helper class
  • C. Remove the falling test methods from the test class.
  • D. Create a test class and methods to cover the Apex trigger

Answer: C

 

NEW QUESTION 48
A developer created a Visualforce page and a custom controller with methods to handle different buttons and events that can occur on the page.
What should the developer do to deploy to production?

  • A. Create a test page that provides coverage of the custom controller.
  • B. Create a test class that provides coverage of the custom controller.
  • C. Create a test page that provides coverage of the Visualforce page.
  • D. Create a test class that provides coverage of the Visualforce page.

Answer: B

 

NEW QUESTION 49
Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage.
How should a developer accomplish this?

  • A. Mark fields as read-only on the page layout.
  • B. Use the Process Automation settings.
  • C. Use a validation rule.
  • D. Use Flow Builder.

Answer: C

 

NEW QUESTION 50
What are two benefits of the Lightning Component framework? (Choose two.)

  • A. It promotes faster development using out-of-box components that are suitable for desktop and mobile devices.
  • B. It simplifies complexity when building pages, but not applications.
  • C. It allows faster PDF generation with Lightning components.
  • D. It provides an event-driven architecture for better decoupling between components.

Answer: A,D

 

NEW QUESTION 51
Which three process automations can immediately send an email notification to the owner of an Opportunity when its Amount is changed to be greater than $10,000? Choose 3 answers

  • A. Workflow Rule
  • B. Process Builder
  • C. Approval Process
  • D. Escalation Rule
  • E. Flow Builder

Answer: A,B,C

 

NEW QUESTION 52
A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?

  • A. Create and populate a custom field on the parent object marked as an External ID.
  • B. Create a custom field on the child object of type Foreign Key
  • C. Create a custom field on the child object of type External Relationship.
  • D. Create and populate a custom field on the parent object marked as Unique

Answer: A

 

NEW QUESTION 53
A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount =[SELECT Id, Type FROM Account WHERE Id =
:apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet:
The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?

  • A. ConverttheAccount.Type to a String.
  • B. Add a getter method for the actType attribute.
  • C. Change theAccount attribute to public.
  • D. Add with sharing to the custom controller.

Answer: B

Explanation:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_custom.htm

 

NEW QUESTION 54
In the code below, which type does String inherit from? String s = 'Hello World';

  • A. Object
  • B. Object
  • C. Class
  • D. Prototype

Answer: A

 

NEW QUESTION 55
Universal Containers wants to back up all of the data and attachments in its Salesforce org once month. Which approach should a developer use to meet this requirement?

  • A. Schedule a report.
  • B. Define a Data Export scheduled job.
  • C. Use the Data Loader command line.
  • D. Create a Schedulable Apex class.

Answer: B

 

NEW QUESTION 56
Refer to the following code snippet for an environment has more than 200 Accounts belonging to the Technology' industry:

When the code execution, which two events occur as a result of the Apex transaction?
When the code executes, which two events occur as a result of the Apex transaction?
Choose 2 answers

  • A. The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.
  • B. If executed In a synchronous context, the apex transaction is likely to fall by exceeding the DHL governor limit.
  • C. If executed in an asynchronous context, the apex transaction is likely to fall by exceeding the DML governor limit
  • D. The Apex transaction fails with the following message. "SObject row was retrieved via SOQL without querying the requested field Account.Is.Tech__c''.

Answer: C

 

NEW QUESTION 57
......

The best PDI exam study material and preparation tool is here: https://simplilearn.lead1pass.com/Salesforce/PDI-practice-exam-dumps.html