Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

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

Page: 5 / 6
Total 202 questions

Universal Containers uses Salesforce to track orders in an order__c object.

The order = object has private organization-wide defaults. The order = object

has a custom field, Quality_Controller_c, that is a Lookup to User and is used

to indicate that the specified User is performing quality control on the order_ co.

What should be used to automatically give read only access to the User set in the

Quality_Controller field?

A.

Record ownership

B.

Criteria-based sharing

C.

Apex managed sharing

D.

User managed sharing

A developer has working business logic code, but sees the following error in the test class:

You have uncommitted work pending. Please commit or rollback before calling out.

What is a possible solution?

A.

Call support for help with the target endpoint, as It is likely an external code error.

B.

Use mast. T=RunningTes={} before making the callout to bypass it in test execution,

C.

Set seeAllData to true the top of the test class, since the code does not fall in practice.

D.

Rewrite the business logic and test classes with @Testvisible set on the callout.

Which use case can be performed only by using asynchronous Apex?

A.

Querying tens of thousands of records

B.

Making a call to schedule a batch process to complete in the future

C.

Calling a web service from an Apex trigger

D.

Updating a record after the completion of an insert

A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record.

What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

A.

Try/catch/finally block

B.

External JavaScript library

C.

Validation rules

D.

Apex trigger

A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes.

Which tool or mechanism should be utilized for managing the source-driven deployment process?

A.

Metadata API

B.

Change Sets

C.

Force.com IDE

D.

Salesforce CLI with Salesforce DX

When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:

System.CalloutException: Unauthorized endpoint

Which recommended approach should the developer implement

to resolve the callout exception?

A.

Annotate the getkRFCatalogContents method with @Future (Callout-true),

B.

Change the access modifier for ERPCatalog from public to global.

C.

Use the SetHeader() method to specify Basic Authentication,

D.

Create a remote site setting configuration that includes the endpoint.

Universal Containers is implementing a new approval process for expense reimbursements. The process requires complex logic to determine the appropriate approver based on factors such as expense amount, employee role, and project type. The solution should allow for flexibility and future changes in the approval rules.

Which approach would be the most suitable for implementing this logic?

A.

Create a custom Apex class with a method to determine the appropriate approver based on the given criteria.

B.

Develop a custom Lightning component to handle the approval logic and integrate it into the expense reimbursement record page.

C.

Implement a custom formula field to calculate and determine the appropriate approver based on the given criteria.

D.

Use the Salesforce Approval Process feature and define multiple approval steps with entry criteria and approval assignments.

An environment has two Apex triggers: an after-update trigger on Account and an after-update trigger on Contact.

The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.

Consider the following: A mass update of 200 Account records’ addresses, where each Account has 50 Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.

What will happen when the mass update occurs?

A.

There will be no error and all updates will succeed, since the limit on the number of records processed by DML statements was not exceeded.

B.

The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements.

C.

There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML statements.

D.

The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements.

The Account object has a field, Audit_Code_c, that is used to specify what type of auditing the Account needs and a Lookup to User, zudizar_c, that is the assigned auditor. When an Account is initially created, the user specifies the Audit_Code c. Each User in the org has a unique text field, Audit_Code _e, that is used to automatically assign the correct user to the Account’s Auditor_c field.

What should be changed to most optimize the code’s efficiency?

Choose 2 answers

A.

Add an initial SOQL query to get all distinct audit codes.

B.

Build a Map> of audit code to accounts.

C.

Build a Map>of Account Id to audit codes.

D.

Add a WHERE clause to the SOQL query to filter on audit codes.

A developer implemented a custom data table in a Lightning web component with filter functionality. However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters.

What should the developer do to improve performance of the component?

A.

Return all records into a list when the component is created and filter the array In JavaScript.

B.

Use a selective SOQL query with a custom Index.

C.

Use SOSL to query the records on filter change.

D.

Use setstoraclel() in the Apex method to store the response In the client-side cache.