Get Real PDI Quesions Pass Salesforce Certification Exams Easily [Q103-Q122]

Share

Get Real PDI Quesions Pass Salesforce Certification Exams Easily

PDI Dumps are Available for Instant Access


Salesforce PDI, or Platform Developer I, is a certification examination designed for individuals who want to demonstrate their knowledge and skills in developing custom applications on the Salesforce platform. PDI exam is intended for developers who have experience in programming languages such as Apex and Visualforce and have worked with the Salesforce platform for at least six months.

 

NEW QUESTION # 103
A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

  • A. @AuraEnabled(cacheable=false)
    public static List<Opportunity> search(String term) { /*implementation*/ }
  • B. @AuraEnabled(cacheable=true)
    publicList<Opportunity> search(String term) { /*implementation*/ }
  • C. @AuraEnabled(cacheable=true)
    public static List<Opportunity> search(String term) { /* implementation*/ }
  • D. @AuraEnabled(cacheable=false)
    public List<Opportunity> search(String term) {/*implementation*/ }

Answer: C


NEW QUESTION # 104
Which Lightning Web Component custom event property settings enable the event to bubble up the containment hierarchy and cross the Shadow DOM boundary?

  • A. bubbles: false, composed: false
  • B. bubbles: tnje, composed: false
  • C. bubbles: true, composed: true
  • D. bubbles: false, composed: true

Answer: C


NEW QUESTION # 105
While writing an Apex class that creates Accounts, a developer wants to make sure that all required fields are handled properly.
Which approach should the developer use to be sure that the Apex class works correctly?

Answer:

Explanation:
Include a try/catch block to the Apex class.


NEW QUESTION # 106
Which code displays the contents of a Visualforce page as a PDF?

  • A. <apex:page contentType="application/pdf">
  • B. <apex:page renderAs="pdf">
  • C. <apex:page contentType="pdf">
  • D. <apex:page rendersAs="application/pdf">

Answer: B

Explanation:
Explanation
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_output_pdf_renderas.htm You can generate a downloadable, printable PDF file of a Visualforce page using the PDF rendering service.
Convert a page to PDF by changing the <apex:page> tag.
<apex:page renderAs="pdf">


NEW QUESTION # 107
Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce page. Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers

  • A. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name.noQuotes() + '%\''; List<Account> results = Database.query(query);
  • B. String query = '%' + name + '%'; List<Account> results = [SELECT Id FROM Account WHERE Name LIKE :query];
  • C. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name + '%\''; List<Account> results = Database.query(query);
  • D. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + String.escapeSingleQuotes(name) + '%\''; List<Account> results = Database.query(query);

Answer: B,D


NEW QUESTION # 108
Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce page. Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers

  • A. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name.noQuotes() + '%\''; List<Account> results = Database.query(query);
  • B. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name + '%\''; List<Account> results = Database.query(query);
  • C. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + String.escapeSingleQuotes(name) + '%\''; List<Account> results = Database.query(query);
  • D. String query = '%' + name + '%';
    List<Account> results = [SELECT Id FROM Account WHERE Name LIKE :query];

Answer: C,D


NEW QUESTION # 109
Consider the following code snippet:

Given the multi-tenant architecture of the Salesforce platform, what Is a best practice a developer should Implement and ensure successful execution of the method?

  • A. Avoid performing queries inside for loops.
  • B. Avoid executing queries without a limit clause.
  • C. Avoid returning an empty List of records.
  • D. Avoid using variables as query filters.

Answer: A


NEW QUESTION # 110
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 and populate a custom field on the parent object marked as Unique.
  • C. Create a custom field on the child object of type External Relationship.
  • D. Create a custom field on the child object of type Foreign Key.

Answer: D


NEW QUESTION # 111
A developer writes a before insert trigger.How can the developer access the incoming records in the trigger body?

  • A. By accessing the Trigger.newMap context variable.
  • B. By accessing the Trigger.new context variable.
  • C. By accessing the Tripper.newList context variable.
  • D. By accessing the Trigger.newRecords context variable.

Answer: B


NEW QUESTION # 112
When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

  • A. Dev Hub
  • B. Production
  • C. Environment Hub
  • D. Sandbox

Answer: A

Explanation:
Explanation
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm When using SalesforceDX, a developer needs to enable Dev Hub in order to create and manage scratch orgs.
A Dev Hub is a special type of org used by developers to store source code and other development-related artifacts. It is also used to create and manage scratch orgs, which are temporary orgs used for development and testing.
Reference: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm


NEW QUESTION # 113
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. 150, 2
  • B. 2, 150
  • C. 11, 150
  • D. 150, 11

Answer: B


NEW QUESTION # 114
Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

  • A. The Lookup Relationship cannot be marked as required on the page layout for the Custom Object.
  • B. The Custom Object inherits security from the referenced Standard Objects
  • C. The Custom Object will be deleted when the referenced Standard Object is deleted.
  • D. The Lookup Relationship on the Custom Object can prevent the deletion of the Standard Object.

Answer: C


NEW QUESTION # 115
A developer must write anApex method that will be called from a lightning component. The method may delete an Account stored in the accountRec variable.
Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletion?

  • A. Account, isDeletable ()
  • B. accountRec., isDeletable()
  • C. AccountRec, ObjecType, ieDeletable ()
  • D. Schena, sobjectType, Account, isDeletetable ()

Answer: D


NEW QUESTION # 116
A developer has requirement to write Apex code to update a large number of account records on a nightly basis. The system administrator needs to be able to schedule the class to run after business hours on an as-needed basis.
Which class definition should be used to successfully implement this requirement?

  • A. Global inherited sharing class ProcessAccount Process implements Queueable
  • B. Gloabal inherited sharing class processAccount Processor implements Database>Bachable<sObject> Schedulable.
  • C. Global inherited sharing class ProcessAccountProcessor implements
    Database. Batchable<sObject>
  • D. Global inherited sharing class ProcessAccountProcess Implements Queueable

Answer: D


NEW QUESTION # 117
A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?

  • A. approval process on the Opportunity object
  • B. An error condition formula on a validation rule on Opportunity
  • C. A record trigger flow on the Opportunity object
  • D. An Apex trigger on the Opportunity object

Answer: B


NEW QUESTION # 118
Universal Containers hires a developer to build a custom search page to help user- find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field.
Which consideration should the developer be aware of when deciding between SOQL and SOSL?
Choose 2 answers

  • A. SOQL is faster for text searches.
  • B. SOSL is able to return more records.
  • C. SOQL is able to return more records.
  • D. SOSL is faster for tent searches.

Answer: C,D


NEW QUESTION # 119
A developer needs to prevent the creation of request records when certain conditions exist in the system. A RequestLogic class exists to checks the conditions. What is the correct implementation?

  • A. Trigger RequestTrigger on Request (after insert) {
    if (RequestLogic.isValid{Request})
    Request.addError {'Your request cannot be created at this time.'};
    }
  • B. Trigger RequestTrigger on Request (after insert) {
    RequestLogic.validateRecords {trigger.new};
    }
  • C. Trigger RequestTrigger on Request (before insert) {
    if (RequestLogic.isvalid{Request})
    Request.addError {'Your request cannot be created at this time.'};
    }
  • D. Trigger RequestTrigger on Request (before insert) {
    RequestLogic.validateRecords {trigger.new};
    }

Answer: D


NEW QUESTION # 120
Refer to the following Apex code:

What is the value of x when it is written to the debug log?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

Answer: D


NEW QUESTION # 121
A developer needs to avoid potential system problems that can arise in a multi-tenant architecture. Which requirement helps prevent poorty written applications from being deployed to a production environment?

  • A. SOQL queries must reference sObActs with their appropriate namespace.
  • B. Unit tests must cover at least 75% of the application's Apex code
  • C. All Apex code must be annotated with the with sharing keyword.
  • D. All validation rules must be active before they can be deployed.

Answer: B


NEW QUESTION # 122
......

Get Instant Access REAL PDI DUMP Pass Your Exam Easily: https://pass4sure.itexamdownload.com/PDI-valid-questions.html