PDI Exam - Platform Developer I (PDI)

certleader.com

Exam Code: PDI (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Platform Developer I (PDI)
Certification Provider: Salesforce
Free Today! Guaranteed Training- Pass PDI Exam.

Free PDI Demo Online For Salesforce Certifitcation:

NEW QUESTION 1

Which approach should a developer use to add pagination to a Visualforce page?

  • A. A StandardController
  • B. The Action attribute for a page
  • C. The extensions attribute for a page
  • D. A StandardSetController

Answer: D

NEW QUESTION 2

The account object has a custom percent field, rating, defined with a length of 2 with 0 decimal places. An account record has the value of 50% in its rating field and is processed in the apex code below after being retrieved from the database with SOQL public void processaccount(){ decimal acctscore = acc.rating c * 100; } what is the value of acctscore after this code executes?

  • A. 5
  • B. 50
  • C. 500
  • D. 5000

Answer: C

NEW QUESTION 3

Which action can a developer take to reduce the execution time of the following code? List<account> allaccounts = [select id from account]; list<account> allcontacts = [select id, accountid from contact]; for (account a :allaccounts){ for (contact c:allcontacts){ if(c.accountid = a.id){ //do work } } }

  • A. Use a map <id,contact> for allaccounts
  • B. Add a group by clause to the contact SOQL
  • C. Put the account loop inside the contact loop
  • D. Create an apex helper class for the SOQL

Answer: A

NEW QUESTION 4

A developer can use the debug log to see which three types of information? Choose 3 answers

  • A. Resource usage and limits
  • B. Database changes
  • C. User login events
  • D. HTTP callout to external systems
  • E. Actions triggered by time-based workflow

Answer: BDE

NEW QUESTION 5

A user selects a value from a multi-select picklist. How is this selected value represented in Apex?

  • A. As a string ending with a comma
  • B. As a string
  • C. As a list< String > with one element
  • D. As a set< string > with one element

Answer: B

NEW QUESTION 6

A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URLWhich statement is unnecessary inside the unit test for the custom
controller?

  • A. Public ExtendedController (ApexPages.StandardController cntrl) { }
  • B. ApexPages.currentPage().getParameters().put('input', 'TestValue')
  • C. Test.setCurrentPage(pageRef),
  • D. String nextPage = controller.save().getUrl();

Answer: AD

NEW QUESTION 7

What are two considerations for custom Apex Exception classes? Choose 2 answers.

  • A. Custom Exceptions cannot be extended by other Exception classes.
  • B. Custom Exception class names must end with the word 'Exception'.
  • C. Custom Exception classes must extend the base Exception class.
  • D. Constructor for custom Exceptions can only accept string values as arguments.

Answer: BC

NEW QUESTION 8

Which two approaches optimize test maintenance and support future declarative configuration changes? Choose 2 answers.

  • A. Create a method that queries for valid records, then call this method within test methods.
  • B. Create a methods that loads valid Account records from a static resources, then call this method within test methods.
  • C. Create a method that performs a callout for valid records, then call this method within test methods.
  • D. Create a method that creates valid records,then call this method within test methods.

Answer: BD

NEW QUESTION 9

Which actions can a developer perform using the Schema Builder?Choose 2 answers

  • A. Create a custom field and automatically add it to an existing page layout.
  • B. Create a view containing only standard and system objects.
  • C. Create a custom object and define a lookup relationship on that object
  • D. Create a view of objects and relationships without fields

Answer: BC

NEW QUESTION 10

A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What step should the developer take to resolve the issue and properly test the exception?

  • A. Use Test.isRunningTest() within the customer controller.
  • B. Use database methods with all or none set to FALSE.
  • C. Use the finally block within the unit test to populate the exception.
  • D. Use try/catch within the unit test to catch the exception.

Answer: D

NEW QUESTION 11

What is a capability of the Force.com IDE? Choose 2 answers

  • A. Roll back deployments.
  • B. Run Apex tests.
  • C. Download debug logs.
  • D. Edit metadata components.

Answer: BD

NEW QUESTION 12

Which two conditions cause workflow rules to fire? Choose 2 answers

  • A. Changing the territory assignments of accounts and opportunities
  • B. Updating records using the bulk API
  • C. Converting leads to person accounts
  • D. An Apex Batch process that changes field values

Answer: BD

NEW QUESTION 13

A developer has the following trigger that fires after insert and creates a child Case whenever a new Case is created. List<Case> childCases = new List<Case>();for (Case parent : Trigger.new){Case child = new Case (ParentId = parent.Id, Subject = parent.Subject);childCases.add(child);}insert childCases; What happens after the code block executes?

  • A. Multiple child cases are created for each parent case in Trigger.new.
  • B. Child case is created for each parent case in Trigger.new.
  • C. The trigger enters an infinite loop and eventually fails.
  • D. The trigger fails if the Subject field on the parent is blank.

Answer: B

NEW QUESTION 14

A developer creates a custom controller and a custom Visualforce page by using the code block below: public class MyController {
public String myString { get {
if (myString == null) { myString = 'a';
}
return myString;
} private set; } public string getMyString (){ return 'getMyString';
} public string getStringMethod () { if (myString == null) {
myString = 'b';
} return myString;
}
} <apex:page controller = "MyController"> {!StringMethod}, {!myString}, {!myString} </apex:page> What can the user expect to see when accessing the custom page?

  • A. A, a, a
  • B. B, b, b
  • C. A, b, getMyString
  • D. B, a, getMyString

Answer: A

NEW QUESTION 15

A developer uses an 'after update' trigger on the Account object to update all the Contacts related to the Account. The trigger code shown below is randomly failing.
List<Contacts> theContacts = new List<Contacts>(); for(Account a : Trigger.new){ for(Contact c : [SELECT Id, Account_Date_c FROM Contact WHERE AccountId = :a.Id]){ c.Account_Date_c = Date.today(); theContacts.add(c);
}
} updates theContacts;
Which line of code is causing the code block to fail?

  • A. An exception is thrown if theContacts is empty
  • B. The trigger processes more than 200 records in the for loop.
  • C. An exception is thrown if Account_Date_c is null.
  • D. A SOQL query is located inside of the for loop.

Answer: D

NEW QUESTION 16

What is a benefit of using a trigger framework?

  • A. Simplifies addition of context-specific logic
  • B. Increases trigger governor limits
  • C. Allows functional code to be tested b
  • D. Reduces trigger execution time

Answer: D

NEW QUESTION 17

What are three characteristics of static methods? (Choose three.)

  • A. Initialized only when a class is loaded
  • B. A static variable outside of the scope of an Apex transaction
  • C. Allowed only in outer classes
  • D. Allowed only in inner classes
  • E. Excluded from the view state for a Visualforce page

Answer: ACE

NEW QUESTION 18

Where can debug log filter settings be set?Choose 2 answers

  • A. The Filters link by the monitored user's name within the web UI.
  • B. The Show More link on the debug log's record.
  • C. On the monitored user's name.
  • D. The Log Filters tab on a class or trigger detail page.

Answer: AD

NEW QUESTION 19

In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers

  • A. After insert
  • B. After update
  • C. Before update
  • D. Before insert

Answer: CD

NEW QUESTION 20

The Review_c object has a lookup relationship up to the Job_Application_c object. The Job_Application c object has a master-detail relationship up the Position_c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review c records on a Visualforce page for a single Position_c record?

  • A. Utilize the Standard Controller for position_c and a Controller Extension to query for Review_c data.
  • B. Utilize the Standard Controller for Position_c and cross-object Formula fields on the job_Application c object to display Review_c data.
  • C. Utilize the Standard Controller for Position_c and cross-object Formula fields on the Review_c object to display Review_c data.
  • D. Utilize the Standard Controller for position_c and expression syntax in the page to display related Review_c data through the job_Application_c object

Answer: A

NEW QUESTION 21

A developer wants to override a button using Visualforce on an object. What is the requirement?

  • A. The controller or extension must have a PageReference method.
  • B. The standardController attribute must be set to the object.
  • C. The action attribute must be set to a controller method.
  • D. The object record must be instantiated in a controller or extension.

Answer: B

NEW QUESTION 22

A developer needs to create records for the object Property_c. The developer creates the following code
block:List propertiesToCreate = helperClass.createProperties();try { // line 3 } catch (Exception exp ) {
//exception handling }Which line of code would the developer insert at line 3 to ensure that at least some records are created, even if a few records have errors and fail to be created?

  • A. Database.insert(propertiesToCreate, false);
  • B. insert propertiesToCreate;
  • C. Database.insert(propertiesToCreate, System.ALLOW_PARTIAL);
  • D. Database.insert(propertiesToCreate);

Answer: A

NEW QUESTION 23

A company wants to create an employee rating program that allows employees to rate each other. An employee's average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records. Which two actions should a developer take to accomplish this task? choose 2 answers

  • A. Create a master-detail relanstionship between the rating and employee object
  • B. Create a trigger on the rating object that updates a field on the employee object
  • C. Create a roll-up sumary field on the employee and use avg to calculate the average rating score
  • D. Create a lookup realntionship beteween the rating and employee object

Answer: AC

NEW QUESTION 24

A developer needs to provide a way to mass edit, update, and delete records from a list view. In which two ways can this be accomplished? Choose 2 answers

  • A. Create a new Visualforce page and Apex Controller for the list view that provides mass edit, update and delete functionality.
  • B. Configure the user interface and enable both inline editing and enhanced lists.
  • C. Download an unmanaged package from the AppExchange that provide customizable mass edit, update, and delete functionality.
  • D. Download a managed package from the AppExchange that provides customizable Enhanced List Views and buttons

Answer: AC

NEW QUESTION 25

A developer runs the following anonymous code block in a Salesforce org with 100 accounts List acc= {select id from account limit 10}; delete acc; database.emptyrecyclebin(acc); system.debug(limits.getlimitqueries()+'
,'+Limits.getlimitDMLStatements()); What is the debug output?

  • A. 1, 2
  • B. 10, 2
  • C. 100, 150
  • D. 150, 100

Answer: C

NEW QUESTION 26

What is a capability of the Developer Console?

  • A. Execute Anonymous Apex code, Create/Edit code, view Debug Logs.
  • B. Execute Anonymous Apex code, Run REST API, create/Edit code.
  • C. Execute Anonymous Apex code, Create/Edit code, Deploy code changes.
  • D. Execute Anonymous Apex code, Run REST API, deploy code changes.

Answer: A

NEW QUESTION 27

A method is passed a list of generic sObjects as a parameter.
What should the developer do to determine which object type (Account, Lead, or Contact, for example) to cast each sObject?

  • A. Use the first three characters of the sObject ID to determine the sObject type.
  • B. Use the getSObjectType method on each generic sObject to retrieve the sObject token.
  • C. Use the getSObjectName method on the sObject class to get the sObject name.
  • D. Use a try-catch construct to cast the sObject into one of the three sObject types.

Answer: B

NEW QUESTION 28

What is a capability of a StandardSetController?Choose 2 answers

  • A. It allows pages to perform mass updates of records
  • B. It allows pages to perform pagination with large record sets
  • C. It enforces field-level security when reading large record sets
  • D. It extends the functionality of a standard or custom controller

Answer: AB

NEW QUESTION 29

How can a developer retrieve all Opportunity record type labels to populate a list collection?Choose 2 answers

  • A. Obtain describe object results for the Opportunity objct.
  • B. Write a for loop that extracts values from the Opportunity.RecordType.Name field.
  • C. Use the global variable $RecordType and extract a list from the map.
  • D. Write a SOQL for loop that iterates on the RecordType object.

Answer: AD

NEW QUESTION 30
......

Thanks for reading the newest PDI exam dumps! We recommend you to try the PREMIUM Downloadfreepdf.net PDI dumps in VCE and PDF here: https://www.downloadfreepdf.net/PDI-pdf-download.html (373 Q&As Dumps)