March Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bigdisc65

Vce PDI Questions Latest

Page: 5 / 17
Question 20

A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List getOpportunityProducts(Set opportunityIds){ List oppLineItems = new List(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } }

The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Options:

A.

Use the System.Limits.getQueries() method to ensure the number of queries is less than 100.

B.

Use the System.Limits.getlimitQueries() method to ensure the number of queries is less than 100.

C.

Refector the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids.

D.

Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.

Question 21

Managers at Universal Containers want to ensure that only decommissioned containers are able to be deleted in the system. To meet the business requirement a Salesforce developer adds "Decommissioned" as ipicklist value for the Statu3__c custom field within the Container__c object.

Which two approaches could a developer use to enforce only Container records with a status of "Decommissioned" can be deleted?

Choose 2 answers

Options:

A.

Validation rule

B.

After record-triggered flow

C.

Apex trigger

D.

Before record-triggered flow

Question 22

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

Options:

A.

A custom exception class must extend the system Exception class.

B.

A custom exception class can implement one or many interfaces.

C.

A custom exception class cannot contain member variables or methods.

D.

A custom exception class name must end with “Exception”.

E.

A custom exception class can extend other classes besides the Exception class.

Question 23

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

Options:

A.

ernit()

B.

fireEvent()

C.

fire()

D.

registerEvent()

Page: 5 / 17
Exam Code: PDI
Exam Name: Platform Developer I (SP23)
Last Update: Mar 29, 2024
Questions: 235
PDI pdf

PDI PDF

$28  $80
PDI Engine

PDI Testing Engine

$33.25  $95
PDI PDF + Engine

PDI PDF + Testing Engine

$45.5  $130