wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PD2 Reviewer 3

Total questions: 60

Worksheet time: 34mins

Name
Class
Date
1.

A company has a custom object, Order__c, that has a required, unique, external ID field called Order_Number__c.

Which statement should be used to perform the DML necessary to insert new records and update existing records in a List of Order__c records?

a)
  • upsert orders;

b)
  • upsert orders Order_Number__c;

c)
  • merge orders Order_Number__c;

d)
  • merge orders;

2.

Consider the following code snippet:

trigger OpportunityTrigger on Opportunity (before insert, before update){
for (Opportunity opp : Trigger-new) {
OpportunityHandler.setPricingStructure (Opp)
}
}

public class OpportunityHandler{
public static void setPricingStructure (Opportunity thisOpp) {
Pricing_Structure__c ps = [Select Type__c FROM Pricing Structure_c WHERE industry__c = thisOpp.Account_Industry_c];
thisOpp.Pricing_Structure__c = ps.Type__c:
update thisOpp;
}
}

Which two best practices should the developer implement to optimize this code?

Choose 2 answers

a)

Use a collection for the DML statement.

b)

Query the Pricing_structure__c records outside of the loop.

c)

Change the trigger context to after update, after insert.

d)

Remove the DML statement.

3.

Which tag should a developer use to display different text while an <apex: commandButton> is processing an action?

a)

<apex:actionPoller>

b)

<apex:actionStatus>

c)

<apex:actionSupport>

d)

<apex: pageMessages>

4.

Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment process feature in a developer sandbox, suddenly left the company.

As part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them; making the Order fulfillment feature ready for its go-live in the production environment.


Unfortunately although a Change Set was started, it was not completed by the former administrator. A developer is brought in to finish the deployment.

What should the developer do to identify the configuration changes that need to be moved into production?

a)

Leverage the Setup Audit Trail to review the changes made by the departed Administrator and identify which changes should be added to the Change Set.

b)

In Salesforce setup, look at the last modified date for every object to determine which should be added to the Change Set.

c)

Set up Continuous Integration and a Git repository to automatically merge all changes from the sandbox metadata with the production metadata.

d)

Use the Metadata API and a supported development IDE to push all of the configuration from the sandbox into production to ensure no changes are lost.

5.

A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value.
Current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time.

There is a new requirement to also display high value opportunities in a Lightning web component.

Which two actions should the developer take to prevent the business logic that obtains the high value opportunities from being repeated in more than one place?

Choose 2 answers

a)

Use custom metadata to hold the high value amount.

b)

Call the trigger from the Lightning web component.

c)

Leave the business logic code inside the trigger for efficiency.

d)

Create a helper class that fetches the high value opportunities.

6.

Refer to the test method below

@isTest
static void testAccountUpdate() {
Account acct = new Account(Name = 'Test');
acet.Integration_Updared__c = false;
insert acct;

CalloutUtil.sendAccountUpd(acct.Id):

Account acctAfter = [SELECT Id, Integration_Updated_c FROM Account WHERE Id = :acct.Id] [0];

System.assert (true, acctAfter.Integration_Updated_c);
}

The test method calls a web service that updates an external system with Account information and sets the Account's Integration_Updated__c checkbox to True when it completes.

The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts."

What Is the optimal way to fix this?

a)

Add test.starttest () before and Test. stoptest () after calloutUcil.sendAcecountUpdate.

b)

Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

c)

Add Test.startTest() before and Test.setMock and Test.stopTest() after Calloututil.sendAccountUpdate.

d)

Add if (!Test.isRunningTest ()) around CalloutUtil.sendAccountUpdate.

7.

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?

Choose 2 answers

a)

Use the @future annotation on the method that performs the aggregate calculation.

b)

Implement the schedulable interface in the class that contains the aggregate calculation method.

c)

Use the @readonly annotation on the method that performs the aggregate calculation.

d)

Implement the Queuable interface in the class that contains the aggregate calculation method.

8.

Given the following code:
for ( Contact c : [SELECT Id, LastName FROM Contact WHERE CreatedDate = TODAY] )
{
Account a = [SELECT Id, Name FROM Account WHERE CreatedDate = TODAY LIMIT 5];
c.Accountid = a.Id?
update c;
}

Assuming there were 10 Contacts and five Accounts created today, what Is the expected result?

a)

System. QueryException: List has more than one row for Assignment on Account

b)

System.LimitException: Too many SOQL Queries on Contact

c)

System.QueryException: Too many DML Statement errors on Contact

d)

System.LimitException: Too many SOQL Queries on Account

9.

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.

A developer received these requirements:
- 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 by Salesforce.
- 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)

Apex REST

b)

Event Monitoring

c)

Invocable Action

d)

SObject Tree

10.

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?

a)

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

b)

Invoke a Schema.describe() function to compare the values of each Name field.

c)

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

d)

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

11.

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user.


The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded"

What step should the developer take to resolve this issue?

a)

Adjust any code that filters by picklist values since they are not indexed.

b)

Split the layout to filter records in one Visualforce page and display the list of records in a second page using the same Apex controller.

c)

Remove instances of the transient keyword from the Apex controller to avoid the view state error.

d)

Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.

12.

The Salesforce admin at Cloud Kicks created a custom object called Region__c to store all postal zip codes in the United States and the Cloud
Kicks sales region the zip code belongs to.

Object Name:
Region__c

Fields:
Zip_Code__c (Text)
Region_Name__< (Text)

Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.

Which code segment Is the most efficient way to fulfill this request?

a)

b)

c)

d)

13.

A company has a custom component that allows users to search for records of a certain object type by invoking an Apex Controller that
returns a list of results based on the user's input. When the search is completed, a searchComplete event is fired, with the results put in a
results attribute of the event. The component is designed to be used within other components and may appear on a single page more than
once.
What is the optimal code that should be added to fire the event when the search has completed?

a)

var evt = component.getEvent ("searchComplete");
evt.setParams((results: results));
eve.fire();

b)

var evt = $A.get ("e.c.searchComplete")
evt.set("v.results", results);
evt.fire()

c)

var evt = $A.get("e.c.searchComplete");
evt.setParams((results: results});
evt.fire();

d)

var evt = component.getEvent ("searchComplete");
evt.set("v.results", results);
evt..fire();

14.

Consider the following code snippet:

public static List<Account> getAccounts (Date thisDate, Id goldenRT) {
List<Account> accountList = [Select Id, Name, Industry FROM Account WHERE CreatedDate = :thisDate OR RecordTypeid = :rgoldenRT];
return accountList;
}

The Apex method is executed in an environment with a large data volume count for Accounts; and the query is performing poorly.

Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result set?

a)

Annotate the method with the @Future annotation.

b)

Create a formula field to combine the CreatedDate and RecordType value, then filter based on the formula.

c)

Use the Database.queryLocater method to retrieve the accounts.

d)

Break down the query into two individual queries and join the two result sets.

15.

A developer is creating a page in App Builder that will be used in the Salesforce mobile app.

Which two practices should the developer follow to ensure the page operates with optimal performance?

Choose 2 answers

a)

Limit five visible components on the page.

b)

Limit 25 fields on the record detail page.

c)

Limit the number of Tabs and Accordion components.

d)

Analyze the page with Performance Analysis for App Builder.

16.

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the
updated records.

public void updateAndMakeCallout(Map<Id, Request_c> reqs, Map<Id, Request_Line_c> reqLines) {

Savepoint sp = Database.setSavepoint ();

try {
insert reqs.values();
insert reqLines.values();
HttpResponse response = CalloutUtil.makeRestCallout (reqs.keySet(), reqLines.keySet());
} catch (Exception e) {
Database.rolilack (sp):
System.debug (e);
}

}
The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error.

What should be done to address the problem?

a)

Move the calloutUtil.makeRestCallour method call below the catch block.

b)

Change the CalloutUtil.makeRestCallout to an @future method.

c)

Remove the Database.setSavepoint and Database.rollback.

d)

Change the CalloutUtil.makeRestCallout to an @InvocableMethed method.

17.

Universal Containers implements a private sharing model for the Convention_Attendee__c custom object. As part of a new quality assurance effort, the company created an Event_Reviewer__c user lookup field on the object. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to.


What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?

a)

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

b)

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

c)

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

d)

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

18.

A page throws an 'Attempt to dereference a null object' error for a Contact.

What change in the controller will fix the error?

a)

Change the getter's signature to be static Contact.

b)

Change the setter's signature to return a Contact.

c)

Use a condition in the getter to return a new Contact if it is null.

d)

Declare a static final Contact at the top of the controller.

19.

Refer to the component code and requirements below:

<lightning: layout multipleRows=""true*>
<lightning:layoutItem size="12">(!v.account.Name}
</lighting: layoutItem>

<lightning:layoutItem size="12">{!v.account .AccountNumber}
</lighting: layoutItem>

<lightning:layoutItem size="12">{!v.account.Industry}
</lighting: layoutiItem>
</lightning: layout>

Requirements:
1. For mobile devices, the information should display In three rows.
2. For desktops and tablets, the information should display in a single row.


Requirement 2 is not displaying as desired.


Which option has the correct component code to meet the requirements for desktops and and tablets?

a)

<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.Name}

</lightning:layoutItem>


<lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.AccountNumber}
</lightning:layoutItem>

<lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4">{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>

b)

<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.Name}
</lightning:layoutItem>


<lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.AccountNumber}

</lightning:layoutItem>


<lightning:layoutItem size="12" largeDeviceSize="4">{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>

c)

<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.Name}
</lightning:layoutItem>


<lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.AccountNumber}

</lightning:layoutItem>


<lightning:layoutItem size="12" mediumDeviceSize="4">{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>

d)

<lightning:layout multipleRows="true">
<lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.Name}

</lightning:layoutItem>


<lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.AccountNumber}

</lightning:layoutItem>


<lightning:layoutItem size="12" mediumDeviceSize="6">{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>

20.

How should a developer assert that a trigger with an asynchronous process has successfully run?

a)

Create all test data, use @future in the test class, then perform assertions.

b)

Create all test data In the test class, Invoke Test.startTest() and Test.stopTest() and then perform assertions

c)

Insert records into Salesforce, use seeAllData=true, then perform assertions.

d)

Create all test data in the test class, use system.runAs() to invoke the trigger, then perform assertions.

21.

As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors
using toast messages. When the development is complete, all the components are added to the same Lightning page.


During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components.


Which two techniques should the developer implement to improve the user experience?

Choose 2 answers

a)

Use a <template> tag to display in-place error messages.

b)

Use a Lightning web component to aggregate and display all errors.

c)

Use the window.alert () method to display the error messages.

d)

Use public properties on each component to display the error messages.

22.

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

a)

Add LIMIT 50000 to every SOQL statement.

b)

Instead of DML statements, use the Database methods with allorNone set to false.

c)

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

d)

Perform all DML operations from within a future method.

23.

A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints. The information needs to be displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process.

How should a developer implement the callouts?

a)

A Continuation for the billing callout and an HTTP REST callout for the tax callout pane Paes

b)

A Continuation for both the billing callout and the tax callout

c)

An HTTP REST callout for the billing callout and a Continuation for the tax callout

d)

An HTTP REST callout for both the billing callout and the tax callout

24.

Lightning web component exists in the system and displays information about the record in context as a modal. Salesforce administrators need to use this component within the Lightning App Builder.


Which two settings should the developer configure within the xml resource file?

Choose 2 answers

a)

Set the isVisible attribute to true.

b)

Specify the target to be lightning __RecordPage.

c)

Specify the target to be lightning AppPage.

d)

Set the IsExposed attribute to true.

25.

A company has a custom object, Order__c, that has a custom picklist field, Status__c, with values of 'New,' "In Progress,' or 'Fulfilled' and a lookup field, Contact__c, to Contact.
Which SOQL query will return a unique list of all the Contact records that have no 'Fulfilled' Orders?

a)

SELECT Id FROM Contact WHERE Id NOT IN (SELECT Contact__c FROM Order__c WHERE Status__c = 'Fulfilled')

b)

SELECT Contact__c FROM Order__c WHERE Status__c <> 'Fulfillied'

c)

SELECT Id FROM Contact WHERE Id NOT IN (SELECT Id FROM Order__c WHERE Status__c = 'Fulfiiled')

d)

SELECT Contact__c FROM Order__c WHERE Id NOT IN (SELECT Id FROM Order_c Where Status__c = 'Fulfilled')

26.

Universal Containers requested the addition of a third-party Map widget to an existing Lightning web component.
Which two actions should the developer take to implement this requirement?

Choose 2 answers

a)

Import the third-party JavaScript module directly into the component.

b)

Use a content distribution network and include <scripr> </s¢ript> tags In the component.

c)

Import LoadScript from lightning/platformResourceLoader.

d)

Upload the third-party JavaScript library as a static resource that imports into the component

27.

As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout.


Which two elements should the developer use to implement these business requirements?

Choose 2 answers

a)

Screen Flow

b)

Lightning web component

c)

Process Builder

d)

Apex method that returns a Continuation object

28.

What is the best practice to initialize Visualforce page in a test class?

a)

Use Test.setCurrentPage(Page.MyTestPage)

b)

Use Test.currentPage.getParameters.put (MyTestPage);

c)

Use controller.currentPage.setPage (MyTestPage):

d)

Use Test.setCurrentPage.MyTestPage;

29.

Consider the following code snippet:

HttpRequest req = new HttpRequest ();
req.setEndpoint ('https://TestEndpoint .example.com/some_path');
req.setMethod('GET');
Blob
headerValue = Blob.valueOf('myUserName' + ' : ' + 'strongPassword');
String authorizationHeader = "BASIC + EncodingUtil.base64Encode (headerValue);
req.setHeader ('Authorization', authorizationHeader) ;
Http http = new Http();
HTTPResponse res = http.send(req);

Which two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code?

Choose 2 answers

a)

Create a Named Credential, endPoint__c, to store the endpoint and credentials.

b)

Store the URL of the endpoint in a custom Label named endPointurt.

c)

Use req.setEndpoint (callout:endPoint__c'); within the callout request.

d)

Use req.setEndpoint (Label.endPointuURL);.

30.

A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the
database, the list is not updating.

data;
@wire(recordList, {recordId : *$recordId'})
records (result) {
if(result.data) {
this.data = result.data;
} else if(result..error){
this.showToast (result.error);
}
}

What should the developer change in the code above for this to happen?

a)

Add the @track decorator to the data variable.

b)

Create a new variable to store the result and annotate it with @track.

c)

Call refreshApex() ON this.data.

d)

Create a variable to store the result and call refreshApex ().

31.

export default class MyOpportunities extends LightningElement {
@api userId;
@wire(getOpportunities, (oppOwner: '$userid"})
opportunities;

}

OpportunityController.cls

public with sharing class OpportunityController {
@AuraEnabled
public static List<Opportunity> findMyOpportunities(Id oppowner) {
return [
SELECT Id, Name, Amount
FROM Opportunity
WHERE OwnerId = :oppOwner
WITH SECURITY_ENFORCED
LIMIT 10

];

}

}

A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by
the currently logged-in user.


When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue?

a)

Use the continuation=true attribute in the Apex method.

b)

Edit the code to use the without sharing keyword in the Apex class.

c)

Use the Cacheable=true attribute in the Apex method.

d)

Ensure the OWD for the Opportunity object Is Public.

32.

A developer used custom settings to store some configuration data that changes occasionally. However, tests are now failing in some of the sandboxes that were recently refreshed.


What should be done to eliminate this issue going forward?

a)

Set the setting type on the custom setting to Hierarchy.

b)

Set the setting type on the custom setting to List.

c)

Replace custom settings with static resources.

d)

Replace custom settings with custom metadata.

33.

A developer wrote the following method to find ail the test accounts in the org:

public static Account[] searchTestAccounts(){
List<List<soObject>> searchList = [ FIND 'test' IN ALL FIELDS
RETURNING Account (Name) ];
return (Account[ ]) searchList [0];
}

However, the test method below fails.

@isTest
public static void testSearchTestAccounts () {
Account a = new Account (nam|e="test");
insert a;
Aecount [] accounts = TestAccountFinder.searchTestAccounts;
System.assert(accounts.size() == 1 );
}

What should be used to fix this failing test? .

a)

Test.loadData to set up expected data

b)

Test.fixedSearchResults() method to set up expected data

c)

@isTest (SesAllData=true) to access org data for the test

d)

@testSetup method to set up expected data

34.

A developer wishes to improve runtime performance of Apex calls by caching results on the client.


What is the most efficient way to implement this?

a)

Set a cookie in the browser for use upon return to the page.

b)

Decorate the server-side method with @AuraEnabled(storable=true).

c)

Decorate the server-side method with @AuraEnabled(cacheable=true).

d)

Call the setstorable() method on the action in the JavaScript client-side code.

35.

A developer wrote an Apex method that makes an HTTP callout to an external system to get specialized data when a button is clicked from a
custom Lightning web component on the Account record page.
Recently, users have complained that it takes longer than desired for the data to appear on the page after clicking the button.

What should the developer use to troubleshoot this issue?

a)

Lightning Inspector

b)

Developer Console

c)

Salesforce CLI

d)

Event Logs

36.

A company uses their own custom-built enterprise resource planning (ERP) system to handle order management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it has shipped.

Which two methods can make this ERP order data visible in Salesforce?

Choose 2 answers

a)

Use Salesforce Connect to view real-time Order data in the ERP system.

b)

Have the ERP system push the data into Salesforce using the SOAP API.

c)

Ensure real-time order data is in Salesforce using the Streaming API.

d)

Write a cron job In Salesforce to poll the ERP system for order updates.

37.

An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class.

How can the developer generate the code coverage?

a)

Verify the user has permissions passing a user into System.runAs().

b)

Call the Apex class method from a testMethod instead of the testSetup method.

c)

Add @testVisible to the method in the class the developer is testing.

d)

Use system.assert() in testSetup to verify the values are being returned.

38.

Which method should be used to convert a Date to a String in the current user's locale?

a)
  • Date.format

b)
  • String.format

c)
  • String.valueOf

d)
  • Date.parse

39.

A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.

Which two components should a developer use to implement the creation of the Case from the Lightning web component?
Choose 2 answers

a)

lightning-input

b)

lightning-record-edit-form

c)

lightning-input-field

d)

lightning-record-form

40.

Ursa Major Solar has a custom object, ServiceJobc, with an optional Lookup field to Account called PartnerService_Provider_c.

The TotalJobs_c field on Account tracks the total number of ServiceJob_c records to which a partner service provider Account is related.

What is the most efficient way to ensure that the TotalJobs_c field is kept up to date?

a)

Create an Apex trigger on ServiceJob_c.

b)
  • Change TotalJobs_c to a roll-up summary field.

c)
  • Create a record-triggered flow on ServiceJob_c.

d)
  • Create a schedule-triggered flow on ServiceJob_c.

41.

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

Choose 3 answers

a)
  • To verify the DOM output of a component

b)
  • To verify that events fire when expected

c)
  • To test a component's non-public properties

d)
  • To test basic user interaction

e)
  • To test how multiple components work together

42.

As part of a custom development, a developer creates a Lightning component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:

Amount, Probability, Stage, or Close Date

How should the developer access the data that must be displayed?

a)

Create a custom date field on Opportunity for each field to track the previous date and execute a SOQL query for date fields.

b)


Execute a SOQL query for Amount, Probability, Stage, and Close Date on the OpportunityHistory object.

c)


Subscribe to the OpportunityHistory Change Data Capture event in the Lightning component.

d)

Subscribe to the Opportunity Change Data Capture event in the Lightning component.

43.

A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution.


How should the developer implement error exception handling in their code to handle this?

a)

Use Database methods to obtain lists of Database. saveResults.

b)


Use Database.setSavepoint() and Database.rollback() with a try-catch statement.

c)


Use a try-catch statement and handle DML cleanup in the catch statement.

d)


Use a try-catch and use sebject.adderror() on any failures.

44.

Which annotation should a developer use on an Apex method to make it available to be wired to a property in a Lightning web component?

a)

@RemoteAction

b)

@AuraEnabled(cacheable=true)

c)

@RemoteAction (cacheable=true)

d)

@AuraEnabled

45.

Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__c.

These are the fields on Customer_Transaction__b:
Account__c

Program__c
Points_Earned__c
Location__c
Transaction_Date__c

The following fields have been identified as Index Fields for the Customer_Transaction__c object; Account__c, Program__c, and
Transaction_Date__c.

Which SOQL query is valid on the Customer_Transaction__b Big Object?

a)


SELECT Account_c, Program_c, Transaction_Date_c FROM Customer_Transaction__c
WHERE Account__c = '001R000000302D3"
AND Program__c INCLUDES ('Shoppers', 'Womens')
AND Transaction_Date__c=2019-05-31T00:002

b)

SELECT Account__c, Program_c, Transaction_Date_c FROM Customer_Transaction__c
WHERE Account__c = '001R000000302D3'
AND Program__c ='Shoppers''
AND Transaction_Date__c=2019-05-31T00:062

c)

SELECT Account_c, Program__c, Transaction_Date_c FROM Customer_Transaction__c
WHERE Account__c = '001R000000302D3'
AND Program__c EXCLUDES ('Shoppers', 'Womens')}
AND Transaction Date_c=2019-05-31T00: 002

d)


SELECT Account__c, Program_c, Transaction_Date_c FROM Customer_Transaction__c
WHERE Account__c ='001R000000302D3'

46.

Given the following containment hierarchy:

<l-- myParentComponent.html -->
<template>
<e-my-child-component></c-my-child-component>
</template>

What is the correct way to communicate the new value of a property named "passthrough" to my-parent-component If the property is
defined within my-child-component?

a)

let cEvent = new CustomEvent ($passthrough);
this.dispatchEvent (cEvent):

b)

let cEvent = new customEvent('passthrough', { detail: 'this.passthrough' });
this.dispatchEvent (cEvent)

c)

let cEvent = new CustomEvent('passthrough', { detail: this.passthrough });
this.dispatchEvent (cEvent);

d)

let cEvent = new CustomEvent ('passthrough') ;
this.dispatchEvent (cEvent):

47.

A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact. The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience.

Given these requirements, what is the recommended solution to develop the application?

a)

Lightning Experience Builder

b)

Aura Components

c)

Visualforce

d)

Lightning Web Components

48.

Users upload .csv files in an external system to create account and contact records in Salesforce. Up to 200 records can be created at a time. The users need to wait for a response from Salesforce in the external system, but the data does not need to synchronize between the two systems.


Based on these requirements, which method should a developer use to create the records in Salesforce?

a)

REST API request using composite/batch/

b)

REST API request using composite/tree/

c)

Apex web services.

d)

Bulk API 2.0

49.

Consider the controller code below that Is called from an Aura component and returns data wrapped in a class.

public class myServerSidetController {
@AuraEnabled
public static MyDataWrapper getSomeData( String theType ) {
Some_Object__¢ someObj = [
SELECT ID, Name
FROM Some_Object__c
WHERE Type oc = :theType
LIMIT 1

];

Another_Object_.c another0bj = [
SELECT ID, Option_¢
FROM Another Object_c
WHERE Some Object_c¢ = :some0bj.Name
LIMIT 1

];

MyDataWrapper theData = new MyDataWrapper();

theData.Name = someObj .Name;
theData.Option = anotherd0bj.Option__c;
return theData;
}


public class MyDataWrapper {
public String Name ( get; set: }
public String Option { gat: set: }

public MyDataWrapper() {}
}
}

The developer verified that the queries return a single record each and there is error handling in the Aura component, but the component is
not getting anything back when calling the controller getsomeData ().

What is wrong?

a)

The member's Name and option should not be declared public.

b)

The member's Name and option of the class MyDataWrapper should be annotated with @AuraEnabled also.

c)

Instances of Apex classes, such as MyDataWrapper, cannot be returned

d)

The member's Name and Option should not have getter and setter

50.

Consider the following code snippet:

import { LightningElement }) from 'lwc':
import getOrders from '@apex/OrderController.getAvailableoOrders';

export default class OrderManagement extends LightningElement {
orders;
error;

@wire (getOrders)
wiredOrders({ error, data }) {
if (data) {
this.orders = data;
this.error = undefined:
} else if (error) {
this.error = error;
this.orders = undefined:
}
}
}

When the component is deployed, an error is reported.
Which two changes should the developer implement in the code to ensure the component deploys successfully?

Choose 2 answers:

a)

import getOrders from '@salesforce/apex/OrderController.getAvailableOrders';

b)

import { LightningElement, api } from 'lwc';

c)

import getOrders from ''@salesforce/apex/c.OrderController.getAvailableOrders';

d)

import{ LightningElement, wire } from 'lwc';

51.

There are user complaints about slow render times of a custom data table within a Visualforce page that loads thousands of Account records at once.

What can a developer do to help alleviate such issues?

a)

Use JavaScript remoting to query the accounts.

b)

Upload a third-party data table library as a static resource.

c)

Use the standard Account List controller and implement pagination.

d)

Use the transient keyword in the Apex code when querying the Account records

52.

A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails.

What might be causing the failed assertion?

a)

The test class is not using system.runas() to run tests as a Salesforce administrator.

b)

The test class has not defined an Account owner when inserting the test data.

c)

The test class has not implemented seeAllData=true in the test method.

d)

The test class has not re-queried the Account record after updating the Opportunity.

53.

public class searchFeature{
public static List<List<sObject>> searchRecords(string searchquery) {
return [FIND searchquery IN ALL FIELDS RETURNING Account, Opportunity, Lead];

A developer created the following test class to provide the proper code coverage for the snippet above:

@isTest
private class searchFeature_Test{

@Testsetup
private static void makeData() {
//insert opportunities, accounts and lead
}

@isTest
private static searchRecords_Test ( ) {
List<List<sObject>> records = searchFeature.searchRecords('Test');
System.assertNotEquals (records.size(), 0);
}
}

However, when the test runs, no data is returned and the assertion fails.


Which edit should the developer make to ensure the test class runs successfully?

a)

Implement the seeAllData=true attribute In the @Istest annotation.

b)

Enclose the method call within Test.startTest() and Test.stopTest ().

c)

Implement the setFixedSearchResults method in the test class.

d)

Implement the without sharing keyword in the searchPeature Apex class

54.

What is a benefit of using a WSDL with Apex?

a)

Enables the user to not pass a Session ID where it is not necessary

b)

Reduces the number of callouts to third-party web services

c)

Allows for web services to be tested and achieve code coverage

d)

Allows for classes to be generated from WSDL and imported into Salesforce

55.

A developer needs to store variables to control the style and behavior of a Lightning Web Component.

Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?

a)

Custom variable

b)

Custom object

c)

Custom metadata

d)

Custom setting

56.

A business currently has a process to manually upload orders from its external Order Management System (OMS) into Salesforce.
This is a labor intensive process since accounts must be exported out of Salesforce to get the IDs. The upload file must be updated with the correct account IDs to relate the orders to the corresponding accounts.

Which two recommendations should make this process more efficient?
Choose 2 answers

a)

Ensure the data In the file is sorted by the order ID.

b)

Use the upsert wizard in the Data Loader to import the data.

c)

Identify unique fields on Order and Account and set them as External IDs.

d)

Use the insert wizard in the Data Loader to import the data.

57.

A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially.

How should the developer write this Apex code without running into governor limits and system limitations?

a)

Use Limits class to stop entire process once governor limits are reached.

b)

Use Apex Scheduler to schedule each process.

c)

Use Queueable Apex to chain the jobs to run sequentially.

d)

Use multiple @future methods for each process and callout.

58.

A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build a single Java application that can create, retrieve, and update common object records in all of the different orgs.

Which method of integration should the application use?

a)

SOAP API with the Enterprise WSDL

b)

SOAP API with the Partner WSDL

c)

Apex REST Web Service

d)

Metadata API

59.

Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs.


What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component?

a)

Apex Batch job that counts the number of Opportunity records

b)

COUNT() SOQL aggregate query on the Opportunity object

c)

SUM() SOQL aggregate query on the Opportunity object

d)

SOQL for loop that counts the number of Opportunities records

60.

Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving an Account.

How can a developer fix this error?

a)

Split the trigger logic into two separate triggers.

b)

Use a helper class to set a Boolean to TRUE the first time a trigger Is fired, and then modify the trigger to only fire when the Boolean Is FALSE.

c)

Convert the trigger to use the @future annotation, and chain any subsequent trigger invocations to the Account object.

d)

Modify the trigger to use the isMultithread=true annotation.