Spring Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: buysanta

Exact2Pass Menu

Salesforce Certified Platform Developer II ( Plat-Dev-301 )

Last Update 8 hours ago Total Questions : 161

The Salesforce Certified Platform Developer II ( Plat-Dev-301 ) content is now fully updated, with all current exam questions added 8 hours ago. Deciding to include PDII practice exam questions in your study plan goes far beyond basic test preparation.

You'll find that our PDII exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these PDII sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any Salesforce Certified Platform Developer II ( Plat-Dev-301 ) practice test comfortably within the allotted time.

Question # 31

A developer needs a Lightning web component to display in one column on phones and two columns on tablets/desktops. Which should the developer add to the code?

A.

Add size= " 12 " medium-device-size= " 6 " to the < lightning-layout-item > elements

B.

Add size= " 6 " small-device-size= " 12 " to the < lightning-layout-item > elements

C.

Add small-device-size= " 12 " to the < lightning-layout-item > elements

D.

Add medium-device-size= " 6 " to the < lightning-layout-item > elements

Question # 32

A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets. What should be used to store this data?

A.

Static resources

B.

Custom metadata

C.

Custom settings

D.

System.Cookie class

Question # 33

A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked domains is stored in a custom object for ease of maintenance by users. The Survey_Response__c object is populated via a custom Visualforce page. What is the optimal way to implement this?

A.

Implement the logic in validation rules on the Contact and the Survey_Response__c objects.

B.

Implement the logic in a helper class that is called by an Apex trigger on Contact and from the custom Visualforce page controller.

C.

Implement the logic in an Apex trigger on Contact and also implement the logic within the custom Visualforce page controller.

Question # 34

A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record. A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception. What should the developer do to ensure the parent always has a child record?

A.

Use Database.insert() and set the allOrNone parameter to true.

B.

Delete the parent record in the catch statement when an error occurs on the child record DML operation.

C.

Set a database savepoint to rollback if there are errors.

D.

Use addError() on the parent record if an error occurs on the child record.

Question # 35

A company wants to run different logic based on an Opportunity ' s record type. Which code segment handles this request and follows best practices?

A.

Java

List < RecordType > recTypes = [SELECT Id, Name FROM RecordType WHERE SobjectType = ' Opportunity ' AND IsActive = True];

Map < String, Id > recTypeMap = new Map < String, Id > ();

for (RecordType rt : recTypes) {

recTypeMap.put(rt.Name, rt.Id);

}

for (Opportunity o : Trigger.new) {

if(o.RecordTypeId == recTypeMap.get( ' New ' )) {

// do some logic Record Type 1 <

B.

Java

for (Opportunity o : Trigger.new) {

if (o.RecordType.Name == ' New ' ) {

// do some logic Record Type 1

}

else if (o.RecordType.Name == ' Renewal ' ) {

// do some logic for Record Type 2

}

}

C.

Java

List < RecordType > recTypes = [SELECT Id, Name FROM RecordType WHERE SobjectType = ' Opportunity ' AND IsActive = True];

Map < String, Id > recTypeMap = new Map < String, Id > ();

for (RecordType rt : recTypes) {

recTypeMap.put(rt.Name, rt.Id);

}

for (Opportunity o : Trigger.new) {

if (recTypeMap.get( ' New ' ) != null & & o.RecordTypeId == recTypeMap.get( ' New ' )) {

<
D.

Java

Id newRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get( ' New ' ).getRecordTypeId();

Id renewalRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get( ' Renewal ' ).getRecordTypeId();

for (Opportunity o : Trigger.new) {

if (o.RecordTypeId == newRecordTypeId) {

// do some logic Record Type 1

}

else if (o.RecordTypeId == renewalRecor

Question # 36

A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products. Whenever a product is created or updated in the PIM, a product must be created or updated as a Product2 record in Salesforce and a PricebookEntry record must be created or updated automatically. The PricebookEntry should be created in a Pricebook2 that is specified in a custom setting. What should the developer use to satisfy these requirements?

A.

SObject Tree REST

B.

Custom Apex REST

C.

Invocable Action

D.

Event Monitoring

Question # 37

A developer wants to write a generic Apex method that will compare the Salesforce Name field between any two object records. For example, to compare the Name field of an Account and an Opportunity; or the Name of an Account and a Contact. Assuming the Name field exists, how should the developer do this? 4

A.

Use a String.replace() method to parse the contents of each Name field and then compare the results.567

B.

Use the Salesforce Metadata API to extrac8t the value of each object and compare the Name fields.910

C.

Cast each object into an sObject and use sObject.get( ' Name ' ) to compare the Name fields.1112

D.

Invo13ke a Schema.describe() function to compare the14 values of each Name field.

Question # 38

Refer to the code snippet below:

Java

public static void updateCreditMemo(String customerId, Decimal newAmount){

List < Credit_Memo__c > toUpdate = new List < Credit_Memo__c > ();

for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) {

creditMemo.Amount__c = newAmount;

toUpdate.add(creditMemo);

}

Database.update(toUpdate,false);

}

A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development, the developer needs to ensure race conditions are prevented when a set of records are mod 1 ified within an Apex transaction. In the preceding Apex code, how can the developer alter the que 2 ry statement to use SOQL features to prevent race conditions within a tr 3 ansaction? 4

A.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR UPDATE]

B.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId USING SCOPE LIMIT 50]

C.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR REFERENCE]

D.

[Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50 FOR VIEW]

Question # 39

What are three reasons that a developer should write Jest tests for Lightning web components?

A.

To test basic user interaction

B.

To test a component’s non-public properties

C.

To test how multiple components work together

D.

To verify the DOM output of a component

E.

To verify that events fire when expected

Question # 40

Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__c, on the Account object that allows sales reps to specify which of UC ' s products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Products__c field. What should the developer do to ensure the value of Products__c is in the current user ' s language? 40

A.

Use toLabel(Products__c) in the fields list of the SOQL que41ry.

B.

Call the translate() method on each record in the SOQL result list.

C.

Set the locale on each record in the SOQL result list.

D.

Use the locale clause in the SOQL query.

Go to page: