Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Pass the Salesforce Developers PDI Questions and answers with ValidTests

Exam PDI All Questions
Exam PDI Premium Access

View all detail and faqs for the PDI exam

Viewing page 4 out of 7 pages
Viewing questions 31-40 out of questions
Questions # 31:

A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing

them to test isolated requirements for various types of Salesforce cases.

Which approach can efficiently generate the required data for each unit test?

Options:

A.

Create a mock using the HttpcalloutMock interface.

B.

Use @TestSetup with a void method.

C.

Add @IsTest (seeAllData=true) at the start of the unit test class.

D.

Create test data before Test .startTest() in the unit test.

Expert Solution
Questions # 32:

What are three considerations when using the @lnvocableMethod annotation in Apex?

Choose 3 answers

Options:

A.

Only one method using the @invecableMethod annotation can be defined per Apex class_

B.

A method using the @invecableMethod annotation can have multiple input parameters.

C.

A method using the @invocablemethod annotation must be declaredas static,

D.

GO A method using the @invocablemethod annotation must define a return value.

E.

A method using the @invocableMethod annotation can be declared as Public or Global.

Expert Solution
Questions # 33:

Which annotation exposes an Apex class as a RESTful web service?

Options:

A.

@RemoteAction

B.

@RestResource (urlMapping='/myService/*"')

C.

@HttpInvocable

D.

@Aurabnabled(cacheable=true)

Expert Solution
Questions # 34:

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

Options:

A.

<apex:outputText value="{!SCurrentPage.parameters.userInput}" />

B.

<apex:outputText escape="false" value="{!sCurrentPage.parameters.userInput}" />

C.

<apex:outputField value="{!ctrl.userInput}" rendered="{!isEditable}" />

D.

<apex:outputField value="{!ctrl.userInput}" />

Expert Solution
Questions # 35:

A developer deployed a trigger to update the status__c of Assets related to an Account when the Account’s status changes and a nightly integration that updates Accounts in bulk has started to fail with limit failures.

Question # 35

What should the developer change about the code to address the failure while still having the code update all of the Assets correctly?

Options:

A.

Move all of the logic to a Queveable class that queries for and updates the Assets and call it from the trigger.

B.

Add List<asset> assets = [SELECT id, Status_¢ FROM WHERE AccountId = : acctId] to line 14 and iterate over the assets list in the for loop on line 15.;

C.

Add a LIMIT clause to the SOQL query on line 16 to limit the number of Assets queried for an Account.

D.

Change the getAssetsToUpdate method to process all Accounts in one call and call it outside of the for loop that starts on line 03.

Expert Solution
Questions # 36:

A developer is designing a new application on the Salesforce platform and wants to ensure it can support multiple tenants effectively.

Which design framework should the developer consider to ensure scalability and maintainability?

Options:

A.

Waterfall Model

B.

Flux (view, action, dispatcher, and store)

C.

Model-View-Controller (MVC)

D.

Agile Development

Expert Solution
Questions # 37:

A developer wants to send an outbound message when a record meets a specific criteria.

Which two features satisfy this use case?

Options:

A.

Flow Builder can be used to check the record criteria and send an outbound message.

B.

Approval Process can be used to check the record criteria and send an outbound message without Apex code.

C.

Entitlement Process can be used to check the record criteria and send an outbound message without Apex code.

D.

Next Best Action can be used to check the record criteria and send an outbound message.

Expert Solution
Questions # 38:

Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.

Question # 38

When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page.

What can the developer use to meet this business requirement?

Options:

A.

Apex

B.

trigger

C.

Controller

D.

extension

Expert Solution
Questions # 39:

A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class.

Which code segment shows the correct declaration of the class and methods?

Options:

A.

apex

Copy

webservice class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

global static String updateRecords() { /* implementation ... */ }

}

B.

apex

Copy

global class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

webservice static String updateRecords() { /* implementation ... */ }

}

C.

apex

Copy

webservice class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

webservice static String updateRecords() { /* implementation ... */ }

}

D.

apex

Copy

global class WebServiceClass {

private Boolean helperMethod() { /* implementation ... */ }

global String updateRecords() { /* implementation ... */ }

}

Expert Solution
Questions # 40:

Which exception type cannot be caught?

Options:

A.

custom exception

B.

LinkException

C.

NoAccessException

D.

CelloutException

Expert Solution
Viewing page 4 out of 7 pages
Viewing questions 31-40 out of questions