Month End Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Pass the Salesforce Developers PDII Questions and answers with CertsForce

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

A developer created an Apex class that updates an Account based on input from a Lightning web component. The update to the Account should only be made if it has not already been registered.

Java

account = [SELECT Id, Is_Registered__c FROM Account WHERE Id = :accountId];

if (!account.Is_Registered__c) {

account.Is_Registered__c = true;

// ...set other account fields...

update account;

}

What should the developer do to ensure that users do not overwrite each other’s updates to the same Account if they make updates at the same time?

Options:

A.

Add a try/catch block around the update.


B.

Use upsert instead of update.


C.

Use FOR UPDATE in the SOQL query.


D.

Include LastModifiedDate in the query to make sure it wasn’t recently updated.


Expert Solution
Questions # 42:

An Aura component has a section that displays some information about an Account and it works well on the desktop, but we have to scroll horizontally to see the description field output on their mobile devices and tablets.

HTML

{!v.rec.Name}

{!v.rec.Description__c}

How should a developer change the component to be responsive for mobile and tablet devices?

Options:

A.

HTML

{!v.rec.Name}

{!v.rec.Description__c}


B.

1

HTML

{!v.rec.Name}

{!v.rec.Description__c}


C.

HTML

{!v.rec.Name}

{!v.rec.Description__c}


D.

HTML

{!v.rec.Name}

{!v.rec.Description__c}


Expert Solution
Questions # 43:

A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format. Which is the optimal method to implement this in Salesforce?

Options:

A.

Apex SOAP web service


B.

Apex SOAP callout


C.

Apex REST callout


D.

Apex REST web service


Expert Solution
Questions # 44:

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

Options:

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.


Expert Solution
Questions # 45:

A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

Options:

A.

The event has multiple handlers registered in the project.


B.

The event is fired from a custom renderer.


C.

An event is fired 'ontouched' and is unhandled.


D.

The event handler calls a trigger.


Expert Solution
Questions # 46:

Which statement is considered a best practice for writing bulk safe Apex triggers?

Options:

A.

Add LIMIT 50000 to every SOQL statement.


B.

Add records to collections and perform DML operations against these collections.


C.

Use the Database methods with allOrNone set to false instead of DML statements.


D.

Perform all DML operations from within a future method.


Expert Solution
Questions # 47:

A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours. Which two steps should a developer take to accomplish this?

Options:

A.

Use the @future annotation.


B.

Implement the Database.Batchable interface.


C.

Implement the Schedulable interface.


D.

Implement the Queueable interface.


Expert Solution
Questions # 48:

Universal Containers implements a private sharing model for Convention_Attendee__c. A lookup field Event_Reviewer__c was created. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to. What is the best approach?

Options:

A.

Create an after insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.


B.

Create a before insert trigger on the Convention Attendee custom object, and use Apex Sharing Reasons and Apex Managed Sharing.


C.

Create criteria-based sharing rules on the Convention Attendee custom object to share the records with the Event Reviewers.


D.

Create a criteria-based sharing rule on the Convention Attendee custom object to share the records with a group of Event Reviewers.


Expert Solution
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions