Salesforce PDI Certification PDI Sample Questions Reliable [Q51-Q76]

Share

Salesforce PDI Certification PDI Sample Questions Reliable

Prepare for the Actual Salesforce PDI PDI Exam Practice Materials Collection

NEW QUESTION 51
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. If executed In a synchronous context, the apex transaction is likely to fall by exceeding the DHL governor limit.
  • B. The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.
  • 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: D

 

NEW QUESTION 52
Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

  • A. fireEvent()
  • B. registerEvent()
  • C. fire()
  • D. ernit()

Answer: C

 

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

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

Answer: B

 

NEW QUESTION 54
What is a capability of the <ltng:require> tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.)

  • A. Specifying loading order.
  • B. Loading externally hosted scripts.
  • C. Loading scripts in parallel.
  • D. One-time loading for duplicate scripts.
  • E. Loading files from Documents.

Answer: A,C,D

 

NEW QUESTION 55
Which three statements are true regarding custom exceptions in Apex? (Choose three.)

  • A. A custom exception class can extend other classes besides the Exception class.
  • B. A custom exception class cannot contain member variables or methods.
  • C. A custom exception class must extend the system Exception class.
  • D. A custom exception class can implement one or many interfaces.
  • E. A custom exception class name must end with "Exception".

Answer: A,C,D

 

NEW QUESTION 56
A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { /*implementation*/ } } Which is the correct implementation?

  • A. Public class CreditcardPayment extends Payment {
    public override void makePayment(Decimal amount) { /*implementation*/ }
    }
  • B. Public class CreditCardPayment implements Payment {
    public virtual void makePayment(Decimal amount) { /*implementation*/ }
    }
  • C. Public class CreditCardPayment implements Payment {
    public override void makePayment(Decimal amount) { /*Implementation*/ }
    }
  • D. Public class CreditCardPayment extends Payment {
    public virtual void makePayment(Decimal amount) { /*implementation*/ }
    }

Answer: A

 

NEW QUESTION 57
For which three items can a trace flag be configured?
Choose 3 answers

  • A. User
  • B. Apex Trigger
  • C. Visualforce
  • D. Apex Class
  • E. Process Builder

Answer: A,B,D

 

NEW QUESTION 58
How can a developer get all of the available record types for the current user on the case object?

  • A. Use describefieldresult of the case.recordtype field
  • B. Use case.getrecordtypes()
  • C. Use SOQL to get all cases
  • D. Use describesobjectresult of the case object

Answer: A

 

NEW QUESTION 59
Which code in a Visualforce page and/or controller might present a security vulnerability?

  • A. <apex:outputField escape="false" value="{!ctrl.userInput}" />
  • B. <apex:outputField value="{!ctrl.userInput}" />
  • C. <apex:outputText value="{!£CurrentPage.parameters.userInput}" />
  • D. <apex:outputText escape="false" value=" {!$CurrentPage.parameters.userInput}" />

Answer: D

 

NEW QUESTION 60
An Account trigger updates all related Contacts and Cases each time an Account is saved using the following two DML statements:
update allContacts; update allCases;
What is the result if the Case update exceeds the governor limit for maximum number of DML records?

  • A. The Account save is retried using a smaller trigger batch size.
  • B. The Account save succeeds and no Contacts or Cases are updated
  • C. The Account save succeeds, Contacts are updated, but Cases are not.
  • D. The Account save fails and no Contacts or Cases are updated

Answer: D

 

NEW QUESTION 61
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 = '%' + name + '%'; List<Account> results = [SELECT Id FROM Account WHERE Name LIKE :query];
  • B. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + String.escapeSingleQuotes(name) + '%\''; List<Account> results = Database.query(query);
  • C. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name.noQuotes() + '%\''; List<Account> results = Database.query(query);
  • D. String query = 'SELECT Id FROM Account WHERE Name LIKE \''%' + name + '%\''; List<Account> results = Database.query(query);

Answer: A,B

 

NEW QUESTION 62
A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface?

  • A. Override the Contact's Edit button with a Lightning component in Salesforce Classic and a Lightning component in Lightning experience.
  • B. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience.
  • C. Override the Contact's Edit button with a Lightning page Salesforce Classic and a Visualforce page in Lightning Experience.
  • D. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning page in Lightning experience.

Answer: B

 

NEW QUESTION 63
What is an accurate statement about variable scope? (Choose 3)

  • A. Sub-blocks can reuse a parent block's variable name if it's value is null.
  • B. Parallel blocks can use the same variable name.
  • C. Sub-blocks cannot reuse a parent block's variable name.
  • D. A static variable can restrict the scope to the current block of its value is null.
  • E. A variable can be defined at any point in a block.

Answer: B,C,E

 

NEW QUESTION 64
An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available for Lighting Web components to use. What is the correct definition of a Lighting Web component property that uses the getAccounts method?

  • A. @AuraEnabled(getAccounts, '$searchTerm')
    accountList;
  • B. @wire(getAccounts, {searchTerm: '$searchTerm'})
    accountList;
  • C. @wire(getAccounts, '$searchTerm')
    accountList;
  • D. @AuraEnabled(getAccounts, {searchTerm: '$searchTerm'})
    accountList;

Answer: B

Explanation:
https://developer.salesforce.com/docs/component-library/documentation/en/48.0/lwc/lwc.data_wire_service_about

 

NEW QUESTION 65
A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this

  • A. Controller.js
  • B. Helper.js
  • C. Superrender.js
  • D. Rendered.js

Answer: B

 

NEW QUESTION 66
A developer wrote the following two classes:

The StatusFetcher class successfully compiled and saved. However, the Calculator class has a compile time error.
How should the developer fix this code?

  • A. Change the class declaration for the Calculator class to public with inherited sharing.
  • B. Change the class declaration for the statusFetcher class to public with inherited sharing.
  • C. Make the doCalculations methodin the Calculation class private.
  • D. Make the isActive method in the StatusFetcher class public.

Answer: D

 

NEW QUESTION 67
A developer must create a lightning component that allows users to input contact record information to create a contact record, including a salary__c custom field. what should the developer use, along with a lightning-record-edit form, so that salary__c field functions as a currency input and is only viewable and editable by users that have the correct field levelpermissions on salary__C?

  • A. <lightning-input-currency value="Salary__c">
    </lightning-input-currency>
  • B. <ligthning-input-field field-name="Salary__c">
    </lightning-input-field>
  • C. <lightning-formatted-number value="Salary__c" format-style="currency">
    </lightning-formatted-number>
  • D. <lightning-input type="number" value="Salary__c" formatter="currency">
    </lightning-input>

Answer: B

 

NEW QUESTION 68
Potential home buyers working with a real estate company can make offers on multiple properties that are listed with the real estate company. Offer amounts can be modified; however, the property that has the offer cannot be modified after the offer is placed. What should be done to associate offers with properties in the schema for the organization?

  • A. Create a master-detail relationship in the contact object to both the property and offer custom objects
  • B. Create a lookup relationship in the offer custom object to the property custom object
  • C. Create a lookup relationship in the property custom object to the offer custom object
  • D. Create a master-detail relationship in the offer custom object to the property custom object

Answer: D

 

NEW QUESTION 69
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. An Apex trigger 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. approval process on the Opportunity object

Answer: B

 

NEW QUESTION 70
A developer needs to implement the functionality for a service agent to gather multiple pieces of information from a customer in order to send a replacement credit card.
Which automation tool meets these requirements?

  • A. Flow Builder

Answer: A

 

NEW QUESTION 71
Which option would a developer use to display the Accounts created in the current week and the number of related Contacts using a debug statement in Apex?

  • A. For(Account acc:[SELECT Id, Name, Account.Contacts FROM Account WHERE CreatedDate = CURRENT_WEEK]) { List cons = acc.Account.Contacts; System.debug(acc.Name + ' has ' + cons.size() + 'Contacts'); }
  • B. For(Account acc: [SELECT Id, Name, (SELECT Id, Name FROM Contacts) FROM Account WHERE CreatedDate = CURRENT_WEEK]){ List cons = acc.Contacts; System.debug(acc.Name + ' has ' + cons.size() + 'Contacts'); }
  • C. For(Account acc: [SELECT Id, Name,(SELECT Id, Name FROM Contacts) FROM Account WHERE CreatedDate = THIS_WEEK]) { List cons = acc.Contacts; System.debug(acc.Name + ' has ' + cons.size() + 'Contacts'; }
  • D. For(Account acc: [SELECT Id, Name, Account.Contacts FROM Account WHERE CreatedDate = THIS_WEEK]){ List cons = acc.Account.Contacts; System.debug(acc.Name + ' has ' + cons.size() +
    'Contacts' }

Answer: C

 

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

  • A. 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.enforceSecurityChecks(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);
  • D. String qryName = '%' + String.escpaeSingleQuotes(name)+ '%'; String qryString = 'SELECT Id FROM Contact WHERE Name LIKE :qryNAme'; List queryResults = Database.query(qryString);

Answer: A,C

 

NEW QUESTION 73
A development team wants to use a deployment script lo automatically deploy lo a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers

  • A. Ant Migration Tool
  • B. Change Sets
  • C. Developer Console
  • D. SFDX CLI

Answer: A,D

 

NEW QUESTION 74
A developer wants to mark each Account in a List<Account> as either or Inactive based on the LastModified field value being more than 90 days.
Which Apex technique should the developer use?

  • A. A for loop, with an if/else statement inside
  • B. A for loop, with a switch statement inside
  • C. An If/else statement, with a for loop inside
  • D. A Switch statement, with a for loop inside

Answer: A

 

NEW QUESTION 75
A developer needs to prevent the creation of Request_c 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) {
    RequestLogic.validateRecords {trigger.new};
    }
  • B. Trigger RequestTrigger on Request (after insert) {
    if (RequestLogic.isValid{Request})
    Request.addError {'Your request cannot be created at this time.'};
    }
  • 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 76
......

Ace Salesforce PDI Certification with Actual Questions Aug 16, 2022 Updated: https://www.easy4engine.com/PDI-test-engine.html

Salesforce PDI Certified Official Practice Test PDI: https://drive.google.com/open?id=1eo_WlwZWswPs_NnP2UNSpuBwPZ24yadQ