Education logo

Salesforce "PDI Exam Braindumps"

"Pass your PDI exam with these free latest Questions and Answers"

By Randy AlanPublished 12 months ago 15 min read
1
{PDI}

1. What are two valid options for iterating through each Account in the collection List<Account> named AccountList? (Choose two.)

(A) for (Account the Account : AccountList) {...}

(b) for(AccountList) {...}

(c) for (List L : AccountList) {...}

(d) for (Integer i=0; i < AccountList.Size(); i++) {...}

Answer(s): A,D

2. A candidate may apply to multiple jobs at the company Universal Containers by submitting a single application per job posting, that application cannot be modified to be resubmitted to a different job posting. What can the administrator do to associate an application with each job posting in the schema for the organization?

(A) Create a lookup relationship on both objects to a junction object called Job Posting Applications.

(b) Create a master-detail relationship in the Job Postings custom object to the Applications custom object.

(c) Create a master-detail relationship in the Application custom object to the Job Postings custom object.

(d) Create a lookup relationship in the Applications custom object to the Job Postings custom object.

Answer(s): C

3. 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(s): A

4. In a single record, a user selects multiple values from a multi-select picklist. How are the selected values represented in Apex?

(A) As a String with each value separated by a comma

(b) As a Set with each value as an element in the set

(c) As a String with each value separated by a semicolon

(d) As a List with each value as an element in the list Previous

Answer(s): C

5. Which two statements are true about Apex code executed in Anonymous Blocks? Choose 2 answers

(A) Successful DML operations are automatically committed

(b) All DML operations are automatically rolled back

(c) The code runs with the permissions of the user specified in the runAs() statement

(d) The code runs with the permissions of the logged user.

(e) The code runs in system mode having access to all objects and fields.

Answer(s): A,D

6.What can a Lightning Component contain in its resource bundle? Choose 2 answer

(A) Custom client side rendering behavior.

(b) Build scripts for minification

(c) Properties files with global settings

(d) CSS styles scoped to the component

Answer(s): A,D

7.A developer wants to list all of the Tasks for each Account on the Account detail page. When a task is created for a Contact, what does the developer need to do to display the Task on the related Account record?

(A) Nothing. The task is automatically displayed on the Account page.

(b) Nothing. The Task cannot be related to an Account and a Contact.

(c) Create a Workflow rule to relate the Task to the Contact's Account.

(d) Create an Account formula field that displays the Task information.

Answer(s): A

8. In which two org types can a developer create new Apex Classes? Choose 2 answers

(A) Developer Edition

(b) Sandbox

(c) Enterprise Edition

(d) Unlimited

Answer(s): A,B

9. What declarative method helps ensure quality data? Choose 3 answers

(A) Page layouts

(b) Lookup filters

(c) Exception handling

(d) Workflow alerts

(e) Validation rules

Answer(s): A,B,E

10. A developer has a block of code that omits any statements that indicate whether the code block should execute with or without sharing. What will automatically obey the organization-wide defaults and sharing settings for the user who executes the code in the Salesforce organization?

(A) Apex Triggers

(b) HTTP Callouts

(c) Apex Controllers

(d) Anonymous Blocks

Answer(s): D

11. How would a developer change the field type of a custom field on the Account object from string to an integer?

(A) Make the changes in the developer console, and then the change will automatically be reflected in the Apex code.

(b) Mate the change in the declarative UI, then update the field type to an integer field in the Apex code.

(c) Make the change in the declarative UI, an then the change will automatically be reflected in the Apex code.

(d) Remove all references in the code, make the change in the declarative UI, and restore the references with the new type.

Answer(s): D

12. Which type of code represents the Controller in MVC architecture on the Force.com platform? (Choose 2)

(A) JavaScript that is used to make a menu item display itself.

(b) A static resource that contains CSS and images.

(c) Custom Apex and JavaScript coda that is used to manipulate data.

(d) Standard Controller system methods that are referenced by Visualforce.

Answer(s): C,D

13. Which statement about change set deployments is accurate? (Choose 3)

(A) They use an all or none deployment model.

(b) They require a deployment connection.

(c) They ca be used to transfer Contact records.

(d) They can be used to deploy custom settings data.

(e) They can be used only between related organizations.

Answer(s): A,B,E

14. What should a developer working in a sandbox use to exercise a new test Class before the developer deploys that test production?Choose 2 answers

(A) The REST API and ApexTestRun method

(b) The Apex Test Execution page in Salesforce Setup.

(c) The Test menu in the Developer Console.

(d) The Run Tests page in Salesforce Setup.

Answer(s): B,C

15. How would a developer determine if a CustomObject__c record has been manually shared with the current user in Apex?

(A) By querying the role hierarchy.

(b) By calling the isShared() method for the record.

(c) By querying Custom Object__Share.

(d) By calling the profile settings of the current user.

Answer(s): C

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

(A) Bulk API

(b) Tooling API

(c) Metadata API

(d) Setup Menu

(e) Developer Console

Answer(s): B,D,E

17. Which two queries can a developer use in a visualforce controller to protect against SOQL injection Vulnerabilities? Choose 2 answers

(A) String qryName = '%' + String.enforceSecurityChecks(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);

(b) String qryName = '%' + name '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);

(c) String qryName = '%' + String.escpaeSingleQuotes(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);

(d) String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);

Answer(s): A,D

18. A developer writes a SOQL query to find child records for a specific parent. How many levels can be returned in a single query?

(A) 1

(b) 7

(c) 5

(d) 3

Answer(s): C

19. A developer wants to use all of the functionality provided by the standard controller for an object, but needs to override the Save standard action in a controller extension. Which two are required in the controller extension class?

(A) Create a method named Save with a return data type of PageReference.

(b) Create a method that references this.superSave()

(c) Define the class with a constructor that takes an instance of Standard Controller as a parameter.

(d) Define the class with a constructor that creates a new instance of the StandardController class.

Answer(s): A,C

20. What is the advantage of Salesforce Lightning?

(A) Uses service side for better handling

(b) Option 4

(c) Pre-defined components to give Standard Look and Feel

(d) Option 3

Answer(s): C

21. On which object can an administrator create a roll-up summary field?

(A) Any object that is on the master side of a master-detail relationship.

(b) Any object that is on the parent side of a lookup relationship.

(c) Any object that is on the detail side of a master-detail relationship.

(d) Any object that is on the child side of a lookup relationship.

Answer(s): A

22. 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(s): A,D

23. A platform developer needs to implement a declarative solution that will display the most recent closed won date for all opportunity records associated with an account. Which field is required to achieve this declaratively?

(A) Roll-up summary field on the opportunity object

(b) Cross-object formula field on the account object

(c) Roll-up summary field on the account object

(d) Cross-object formula field on the opportunity object

Answer(s): C

24. What are two considerations for deciding to use a roll-up summary field? Choose 2 answer's partner.

(A) Roll-up summary can be performed on formula fields, but if their formula contains an #Error result, it may affect the summary value.

(b) Roll-up summary fields do not cause validation rules on the parent object unless that object is edited separately.

(c) Roll-up cannot be performed on formula fields.

(d) Roll-up cannot be performed on formula fields that use cross-object references or on-the-fly calculations such as NOW().

Answer(s): A,D

25. What is a valid way of loading external JavaScript files into a Visualforce page? (Choose 2)

(A) Using an (apex:includeScript)* tag. \>

(b) Using an (apex:define)* tag.

(c) Using a (link)* tag.

(d) Using a (script)* tag.

Answer(s): A,D

26. A custom exception "RecordNotFoundException" is defined by the following code of block.public class RecordNotFoundException extends Exception()which statement can a developer use to throw a custom exception?choose 2 answers

(A) Throw new RecordNotFoundException("problem occured");

(b) Throw new RecordNotFoundException();

(c) Throw RecordNotFoundException("problem occured");

(d) Throw RecordNotFoundException();

Answer(s): A,B

27. Which code segment can be used to control when the dowork() method is called?

(A) For (Trigger.isRunning t: Trigger.new) { dowork(); }

(b) If(Trigger.isRunning) dowork();

(c) For (Trigger.isInsert t: Trigger.new) { dowork(); }

(d) If(Trigger.isInsert) dowork();

Answer(s): D

28. A developer writes a before insert trigger.How can the developer access the incoming records in the trigger body?

(A) By accessing the Trigger.new context variable.

(b) By accessing the Trigger.newRecords context variable.

(c) By accessing the Trigger.newMap context variable.

(d) By accessing the Tripper.newList context variable.

Answer(s): A

29. 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(s): A,D

30. What is a capability of formula fields? (Choose 3)

(A) Generate a link using the HYPERLINK function to a specific record in a legacy system.

(b) Display the previous values for a field using the PRIORVALUE function.

(c) Return and display a field value from another object using the VLOOKUP function.

(d) Determine if a datetime field has passed using the NOW function.

(e) Determine which of three different images to display using the IF function.

Answer(s): A,D,E

31. The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults? What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record? Select one of the following:

(A) Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Job_Application_c object to display Review_c data.

(b) Utilize the Standard Controller for Position_c and a Controller Extension to query for Review_c data.

(c) Utilize the Standard Controller for Position_c and expression syntax in the Page to display related Review_c through the Job_Applicacion_c inject.

(d) Utilize the Standard Controller for Position_c and cross-object Formula Fields on the Review_c object to display Review_c data.

Answer(s): B

32. What is the debug output of the following Apex code? Decimal theValue; System.debug (theValue);

(A) 0.0

(b) null

(c) Undefined

(d) 0

Answer(s): B

33.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(s): B,D

34.Which resource can be included in a Lightning Component bundle? Choose 2 answers

(a) Apex class

(b) Adobe Flash

(c) JavaScript

(d) Documentation

Answer(s): C,D

35.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(s): B,D

36. 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(s): B,D

37. Which two combined methods should a developer use to prevent more than one open Opportunity on each Account? Choose 2 answers

(a) Create an Account Roll-up Summary field to count open Opportunities

(b) Create an Opportunity Validation Rule to generate an error on insert

(c) Create an Account Trigger to generate an error on Opportunity insert

(d) Create an Opportunity Workflow Rule to auto-close the Opportunity

Answer(s): A,B

38. Where would a developer build a managed package?

(a) Developer Sandbox

(b) Unlimited Edition

(c) Partial Copy Sandbox

(d) Developer Edition

Answer(s): D

39. What is an accurate constructor for a custom controller named "MyController"?

(a) public MyController () { account = new Account () ; }

(b) public MyController (sObject obj) { account = (Account) obj; }

(c) public MyController (List objects) { accounts = (List ) objects; }

(d) public MyController (ApexPages.StandardController stdController) { account = (Account) stdController.getRecord(); }

Answer(s): A

40. Which action can a developer perform in a before update trigger? (Choose 2)

(a) Display a custom error message in the application interface.

(b) Change field values using the Trigger.new context variable.

(c) Delete the original object using a delete DML operation.

(d) Update the original object using an update DML operation.

Answer(s): A,B

41.Which action can a developer perform in a before update trigger? (Choose 2)

(a) Display a custom error message in the application interface.

(b) Change field values using the Trigger.new context variable.

(c) Delete the original object using a delete DML operation.

(d) Update the original object using an update DML operation.

Answer(s): A,B

42. Given the code below, what can be done so that recordcount can be accessed by a test class, but not by a non-test class? Public class mycontroller{ private integer recordcount; }

(a) Add a seealldata annotation to the test class

(b) Add the testvisible annotation to recordcount

(c) Change recordcount from private to public

(d) Add the testvisible annotation to the mycontroller class

Answer(s): B

43. What can a developer use to determine if the core Apex code exceeds any governor limits in a test class during bulk execution?

(a) Limits, startTest, stopTest

(b) Test.getDmlStatements()

(c) @TestSetup.

(d) @TestVisible

Answer(s): A

44. A company wants to create an employee rating program that allows employees to rate each other. An employees 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?

(a) Create a trigger on the Rating object than updates a field on the Employee object.

(b) Create a roll-up summary field on the Employee and use AVG to calculate the average rating score.

(c) Create a lookup relationship between the Rating and Employee object.

(d) Create a master-detail relationship between the Rating and Employee objects.

Answer(s): B

45. To which primitive data type is a text area (rich) field automatically assigned?

(a) Text

(b) Blob

(c) Object

(d) String

Answer(s): D

46. How can a developer warn users of SOQL governor limit violations in a trigger?

(a) Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit.

(b) Use PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of SOQL queries exceeds the limit.

(d) Use Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit.

Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.

Answer(s): D

47. 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(s): B,C

48. Which data structure is returned to a developer when performing a SOSL search?

(a) A list of lists of sObjects.

(b) A map of sObject types to a list of sObjects

(c) A map of sObject types to a list oflists of sobjects

(d) A list of sObjects.

Answer(s): A

49. Which two condition cause workflow rules to fire? Choose 2 answers

(a) Changing territory assignments of accounts and opportunities

(b) Updating record using bulk API

(c) Converting leads to person account

(d) An Apex batch process that changes field values

Answer(s): B,D

50. Opportunity opp=[SELECT Id,StageName FROM Opportunity LIMIT 1]; Given the code above,how can a developer get the label for the StageName field?

(a) Call Opportunity.StageName.Label

(b) Call Opportunity.StageName.getDescribe().getLabel()

(c) Call Opp.StageName.getDescri

(d) Call Opp.StageName.Label

Answer(s): B

51. On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID that is passed on the URL?

(a) Use the constructor method for the controller.

(b) Use the $Action.View method in the Visualforce page.

(c) Create a new PageReference object with the Id.

(d) Use the tag in the Visualforce page.

Answer(s): A

52. A developer runs the following anonymous code block:List<Account> acc = [SELECT Id FROM Account LIMIT 10];Delete acc;Database.emptyRecycleBin(acc);system.debug(Limits.getDMLStatements()+ `, ` +Limits.getLimitDMLStatements());What is the result?

(a) 11, 150

(b) 150, 2

(c) 150, 11

(d) 2, 150

Answer(s): D

53. Given the code below, which three statements can be used to create the controller variable? Public class accountlistcontroller{ public list<account>getaccounts(){ return controller.getrecords(); } } Choose 3 answers

(a) Apexpages.standardsetcontroller controller=new apexpages.standardsetcontroller(database.getquerylocator('select id from account'));

(b) Apexpages.standardcontroller controller= new apexpages.standardcontroller([select id from account]);

(c) Apexpages.standardcontroller controller= new apexpages.standardcontroller(database.getquerylocator('select id from account'));

(d) Apexpages.standardsetcontroller controller = new apexpages.standardsetcontroller (database.query('select id from account'));

(d) Apexpages.standardsetcontroller controller = new apexpages.standardsetcontroller (database.getquerylocator([select id from account]));

Answer(s): B,D,E

54. Which resource can be included in a Lightning Component bundle? Choose 2 answers

(a) Apex class

(b) Adobe Flash

(c) JavaScript

(d) Documentation

Answer(s): C,D

55. From which two locations can a developer determine the overall code coverage for a sandbox? Choose two answers

(a) The Apex classes setup page

(b) The Test Suite Run panel the Developer Console

(c) The Test Tab of the Developer Console

(d) The Apex Test Execution page

Answer(s): A,C

56. Which type of code represents the Model in the MVC architecture when using Apex and Visualforce pages?

(a) A Controller Extension method that saves a list of Account records

(b) Custom JavaScript that processes a list of Account records

(c) A list of Account records returned from a Controller Extension method

(d) A Controller Extension method that uses SOQL to query for a list of Account records

Answer(s): C

57. What is the accurate statement about with sharing keyword? choose 2 answers

(a) Inner class do not inherit the sharing setting from the container class

(b) Both inner and outer class can be declared as with sharing

(c) Either inner class or outer classes can be declared as with sharing but not both

(d) Inner class inherit the sharing setting from the container class

Answer(s): A,B

58. Which standard field is required when creating a new contact record?

(a) LastName

(b) Name

(c) AccountId

(d) FirstName

Answer(s): A

59. What is accurate statement about with sharing keyword? Choose 2 answers

(a) Either inner or outer classes can be declared as with sharing, but not both

(b) Both inner and outer classes can be declared as with sharing

(c) Inner classes do not inherit the sharing settings from the container class

(d) Inner classes inherit the sharing settings from the container class.

Answer(s): B,C

60. Which type of information is provided by the Checkpoints tab in the Developer Console? (Choose 2)

(a) Namespace

(b) Time

(c) Exception

(d) Debug Statement

Answer(s): A,B

61. From which 2 locations can a developer determine the overall code coverage for a sandbox?

(a) The test suite run panel of the developer console

(b) The apex classes setup page

(c) The apex test execution page

(d) The tests tab of the developer console

Answer(s): B,D

coursesinterview
1

About the Creator

Randy Alan

Hello Everyone, here I talk about Education, Health and Love

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.