Winter Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ex2p65

Exact2Pass Menu

Question # 4

A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.

What can cause this problem?

A.

The test class does not retrieve the updated value from the database,

B.

The test class does not use the Bulk API for loading test data.

C.

The test class does not use the seeallData=true= annotation.

D.

The test class does not implement the Queueable interface.

Full Access
Question # 5

Universal Containers ne=ds to integrate with several external systems. The process Is Initiated when a record Is created in Salesforce, The remote systems do not require Salesforce to wait for a response before continuing.

What is the recommended best solution to accomplish this?

A.

PushTopic event

B.

Qutbound message

C.

Trigger with HTTP callout

D.

Platform event

Full Access
Question # 6

Consider the following code snippet:

How should the component communicate to the

component that an order has been selected by the user?

A.

Create and fire a component event.

B.

Create and fire an application event.

C.

Create and fire a standard DOM event.

D.

Create and dispatch a custom event,

Full Access
Question # 7

A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called rsutils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library,

Which statement properly loads the static resource within the LWC?

A.

import jsUtilities from ‘@salesforce/rescurceUr1/jaUtiles’;

B.

C.

const jsUtilivy = SA.get{'SResource.isUtils');

D.

impore {jsUtilities} from ‘@salasforce/resourceUrl/jsUtils’;

Full Access
Question # 8

Consider the queries in the options below and the following Information:

* For these queries, assume that there are more than 200,000 Account records.

* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.

* There are two fields that are marked as External Id on the

Account. These fields are customer_Number_c and ERR_Key_ s.

Which two queries are optimized for large data volumes?

Choose 2 answers

A.

SELECT I4 FROM Account WHERE Name !— NULL

B.

SELECT 1d FROM Accounts WHERE Name != '°

AND Customer_Number_c- "ValueA’

C.

SELECT ID FROM Account WHRE id IN :aListVariable

D.

SELECT Id FROM Account WHERE Name != ‘ ‘AND IsDeleted = false

Full Access
Question # 9

Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations.

When a customer service agent enters the credit card information, it must be sent

to 8 3rd-party payment processor for the donation to be processed, UC uses one

payment processor for individuals and a different one for corporations.

What should a developer use to store the payment processor settings for the

different payment processors, so that their system administrator can modify the

settings once they are deployed, if needed?

A.

Custom object

B.

Custom metadata

C.

Hierarchy custom setting

D.

List custom setting

Full Access
Question # 10

Universal Containers is leading a development team that follows the source-driven development approach in Salesforce. As part of their continuous integration and delivery (CL/CD) process, they need to automatically deploy changes to multiple environments, including sandbox and production.

‘Which mechanism or tool would best support their CI/CD pipeline in source-driven development?

A.

Salesforce CLI with Salesforce DX

B.

Salesforce Extensions for Visual Studio Code

C.

Change Sets

D.

Ant Migration Tool

Full Access
Question # 11

A developer is working on an integration between Salestorce and an external system. The integration requires sending a large amount of data to the external systern, which can cause long response times and timeouts.

To optimize the performance and avoid timeouts, which technique should be used?

A.

Use a chained batch Apex to split the data into smaller batches.

B.

Implement an asynchronous callout using the Continuation class,

C.

Increase the timeout limit in the callout options,

D.

Use the @future annotation to make the callout asynchronous.

Full Access
Question # 12

Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript and C55 files. They want to ensure efficient loading and caching of the page.

Which feature should be utilized to achieve this goal?

A.

ActionFunction

B.

PageBlockTable

C.

Static resources

D.

RemoteAction

Full Access
Question # 13

Instead of waiting to send emails to support personnel directly from the finish

method of a batch Apex process, Universal Containers wants to notify an external

system in the event that an unhandled exception occurs.

What is the appropriate publish/subscribe logic to meet this requirement?

A.

Publish the error event using the Eventbus. publish () method.

B.

No publishing is necessary. Have the external system subscribe to the BatchapexErrorEvent.

C.

Publish the error event using the addError method.

D.

Publish the error event with a Flow.

Full Access
Question # 14

Consider the Apex class below that defines a RemoteAction used on 2 Visualforce search page.

Which code snippet will assert that the remote action returned the correct Account?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 15

Refer to the test method below:

The test method calls an @future method that increments the

Number_of_Times_Viewed__c value. The assertion is failing because the

Number of Times Viewed_c equals 0.

What is the optimal way to fix this?

A.

Change the assertion to system.asserciquals (0, acctAfter Number _Cf_Timea_Viewed__c).

B.

Add Test.atartTeat() before and Teat.stopTest() after inser= acct.

C.

Add rest.staztTest() before and Test.stopTess() after AuditUcil.incrementViewed.

D.

Change the initialization to acct. Number_Of_Times_Viewed_c = 1.

Full Access
Question # 16

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 List.

B.

Replace custom settings with static resources.

C.

Set the setting type on the custom setting to Hierarchy.

D.

Replace custom settings with custom metadata.

Full Access
Question # 17

A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.

The following test fails:

What should be done to make this test pass?

A.

Create Accountdistory records manually in the test setup and write a query to get them.

B.

Use @isTest (SeeAllData=true] to see historical data from the org and query for Accountdistory records.

C.

Use Test. isRunningTest (] in getAccountHistory() to conditionally return fake AccountHistory records.

D.

The tact method should he delated since this code cannat be tested

Full Access
Question # 18

A developer has a test class that creates test data before making a mock callout but now receives a 'You have uncommitted work pending. Please commit or rollback before calling out’ error.

Which step should be taken to resolve the error?

A.

Ensure both the Insertion and mock callout occur after the I==L. stoptest_().

B.

Ensure the records are Inserted before the Tezt.startTest() statement and the mock callout occurs within a method annotated with @testSetup.

C.

Ensure both the insertion and mock callout occur after the Test.startTest().

D.

Ensure the records are inserted before the Test.startTess() statement and the mock callout occurs after the Test. Startest().

Full Access
Question # 19

The Salesforce admin et 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.

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)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 20

Consider the Apex controller below, that is called from an Aura component.

What is wrong with this code?

A.

Line 1: class must be global

8. Lines 1 and 6: class and method must be global

B.

Line 6: method must be static

C.

Line 8: method must first serialize the list to JSON before returning

Full Access
Question # 21

A company's support process dictates that any time a case is closed with a status of "Could net fix," an Engineering Review custom object record should be created and populated with information from the case, the contact, and any of the products associated with the case.

What Is the correct way to automate this using an Apex trigger?

A.

An after update trigger on Case that creates the Engineering Review record and inserts it

B.

An after upset trigger on Case that creates the Engineering Review record and inserts It .

C.

A before update trigger on Case that creates the Engineering Review record and Inserts It

D.

A before upset trigger on Case that creates the Engineering Review record and Inserts it

Full Access
Question # 22

A company has a web page that needs to get Account record information, such as name, website, and employee number. The Salesforce record 1D is known to the web page and it uses JavaScript to retrieve the account information.

Which method of integration is optimal?

A.

Apex SOAP web service

B.

SOAP API

C.

Apex REST web service

D.

REST API

Full Access
Question # 23

A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.

What can a developer use to analyze and diagnose the problem in the Lightning page?

A.

Salesforce Lightning Inspector Transactions tab

B.

Salesforce Lightning Inspector Actions tab

C.

Salesforce Lightning Inspector Event Log tab

D.

Salesforce Lightning Inspector Storage tab

Full Access
Question # 24

Universal Containers has an Apex trigger on Account that creates an Account Plan record when an Account is marked as a Customer.

Recently a record-triggered flow was added so that whenever an Account is marked as a Customer, a "Customer Since’ date field is updated with today's date. Since the addition of the flow, two Account Plan records are created whenever the Account is marked as a Customer.

What might cause this to happen?

A.

The Apex trigger does not use a static variable to ensure it only fires once.

B.

The flow is configured to use an "Update Records’ element.

C.

The Apex trigger is not bulk safe and calls insert inside of a for loop.

D.

The flow is configured to evaluate when a record is created and every time it is edited.

Full Access
Question # 25

A developer is asked to develop a new AppFxchange application. A feature of the program creates Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to

most customers.

What should the developer use to store and package the custom configuration settings for the app?

A.

Custom objects

B.

Custom settings

C.

Custom metadata

D.

Custom labels

Full Access
Question # 26

A developer is building a Lightning web component that searches

for Contacts. The component must communicate the search

results to other unrelated Lightning web components, that are in

different DOM trees, when the search completes.

What should the developer do to implement the communication?

A.

Fire an application event.

B.

Publish an event on an event channel.

C.

Fire a custom component event.

D.

Publish a message on a message channel.

Full Access
Question # 27

Universal Containers (LIC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish-speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site.

What should the developer use to ensure the site is multilingual?

A.

Use custom labels to ensure custom messages are translated properly.

B.

Use custom settings to ensure custom messages are translated properly.

C.

Use custom objects to translate custom picklist values.

D.

Use custom metadata to translate custom picklist values.

Full Access
Question # 28

Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Product__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 Product_c field.

What should the developer do to ensure the value of Products__c is in the current user's language?

A.

Use tolabel ducts__c) in the fields list of the SOQL query.

B.

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

C.

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

D.

Use the Locale clause in the SOQL query.

Full Access
Question # 29

Universal Containers stores user preferences in a hierarchy custom setting,

user Prefs_c, with a checkbox field, show _help co. Company-level defaults are

stored at the organizational level, but may be overridden at the user level. If a user

has not overridden preferences, then the defaults should be used.

How should the show_Help_ c preference be retrieved for the current user?

A.

Boolean show = User_Prefa_ c.getValuea().Show_Help_ co;

B.

Boolean show =

User Prefs c.getValues(UserInfo.getUserid{)).Show_Help c;

C.

Boolean show = User_Prefs_c.getlnstance(].Show Help c;

D.

Boolean show = User Prefs_c.show Melp_c;

Full Access
Question # 30

The use of the transient keyword in Visualforce page controllers helps with which common performance issue?

A.

Reduces load times

B.

Improves page transfers

C.

Reduces view state

D.

Improves query performance

Full Access
Question # 31

A Salesforce developer is hired by a multi-national company to build a custom

Lightning application that shows employees their employment benefits and earned

commissions over time. The application must acknowledge and respect the user's

locale context for dates, times, numbers, currency, and currency symbols.

When using Aura components, which approach should the developer implement to

ensure the Lightning application complies with the user's locale?

A.

Use the $User global variable to retrieve the user preferences.

B.

Use the $Label global value provider.

C.

Use the $Lacale value provider to retrieve the user preferences.

D.

Create a Hierarchical custom setting to store user preferences.

Full Access
Question # 32

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

A.

Define a method that creates test data and annotate with @testSetup.

B.

Define a method that creates test data and annotate with @createData.

C.

Ensure proper usage of test data factory in all test methods.

D.

Reduce the amount of test methods in the class.

Full Access
Question # 33

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 meet these business requirements, and also prevent the business logic that obtains the high value opportunities from

being repeated in more than one place?

Choose 2 answers

A.

Call the trigger from the Lightning web component.

B.

Create a helper class that fetches the high value opportunities,

C.

Leave the business logic code inside the trigger for efficiency.

D.

Use custom metadata to hold the high value amount.

Full Access
Question # 34

An org has 2 requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.

What is the optimal way to implement this?

A.

Apex triggers on Contact and Account that call a helper class to normalize the address

B.

Apex trigger on Account that calls the Contact trigger to normalize the address

C.

Apex triggers on Contact and Account that normalize the address

D.

Apex trigger on Contact that calls the Account trigger to normalize the address

Full Access
Question # 35

Refer to the component code and requirements below:

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 36

A developer created 2 class that implements the Queueable Interface, as follows:

As part of the deployment process, the developer is asked to create a corresponding test class.

Which two actions should the developer take to successfully execute the test class?

Choose 2 answers

A.

Implement seeAllData=True to ensure the Queueable job is able to run in bulk mode.

B.

Ensure the running user of the test class has, at I the View All permission on the Order object.

C.

Enclose System.enqueueJob(new OrderQueueableJob ()] within Tess. and Test .stopTest (1.

D.

Implement Test. isRunningTest() to prevent chaining jobs during test execution.

Full Access
Question # 37

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.

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

happen?

A.

Call rafrasnApex() ON this.dazta.

B.

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

C.

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

D.

Add the @track decorator to the data variable.

Full Access
Question # 38

A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method,

Contacts, returns a list of Contacts and will be wired to a property in the component.

Which two lines must change in the above code to make the Apex method able to be wired?

Choose 2 answers

A.

Add @AuraEnabled {cacheable=trues) to line 08.

B.

Remove private from line 09.

C.

Add public to line 04.

D.

Add @AuraEnabled {cacheable=true) to line 03.

Full Access
Question # 39

Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers’ sales representatives can edit the orders on the same Visualforce page.

What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?

A.

use System. profiles=() to test as a sales rep and a community user.

B.

use System. profiles() to test as an administrator and a community user.

C.

use System. profiles1h=() to test as a sales rep and a community user.

D.

use System. runsAs () to test as an administrator and a community user.

Full Access
Question # 40

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 41

A developer is asked to replace the standard Case creation screen with a custom screen that takes users through a wizard before creating the Case. The org only has users running Lightning Experience.

What should the developer override the Case New Action with to satisfy the requirements?

A.

Lightning Page

B.

Lightning Record Page

C.

Lightning Component

D.

Lightning Flow

Full Access
Question # 42

A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.

What should the developer do to determine which objects to include in the response?

A.

Check the isCustom() value on the sObject describe result,

B.

Import the list of all custom objects from @salesforce/schema.

C.

Check the getobiectType [) value for ‘Custom’ or "Standard’ on the sObject describe result.

D.

Use the getcustomobjects() method from the Schema class.

Full Access
Question # 43

Business rules require a Contact ta always be created when a new Account is created.

What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

A.

Use setSaverpoint (1) and rollback() with a try-catch block.

B.

Use the Database. Insect method with a11orNone SEL LO alee,

C.

Use the Database. Delete method if the Contact insertion fails.

D.

Disable validation rules on Contacts and set default values with a trigger.

Full Access
Question # 44

A company has many different unit test methods that create Account records as

part of their data setup. A new required field was added to the Account and now all

of the unit tests fail.

What is the optimal way for a developer to fix the issue?

A.

Add the required field to the data setup for all of the unit tests.

B.

Add a before insert trigger on Account to set the value of the required field,

C.

Change the required field to be a validation rule that excludes the System Administrator profile.

D.

Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

Full Access
Question # 45

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.

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

B.

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

C.

Call the Apex class method from a testsetup Instead of the testsetup methed.

D.

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

Full Access
Question # 46

A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met.

What is the optimal way to accomplish this?

A.

Use an Email Alert with Flow Builder.

B.

Use MassEmailMEssage () With an Apex trigger.

C.

Use a Workflow Email Alert.

D.

Use SingleEmailMessage() with an Apex trigger.

Full Access
Question # 47

Consider the following code snippet:

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.

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

B.

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

C.

Annotate the method with the @Future annotation

D.

Use the Database queryLocator method to retrieve the accounts.

Full Access
Question # 48

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

Full Access
Question # 49

A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow.

What can a developer to do address the issue?

A.

Turn off triggers, flows, and validations when running tests.

B.

Move the prerequisite reference data setup to a TestDataFactory and call that from each test method,

C.

Move the prerequisite reference data setup to a @testSetup method in the test class.

D.

Move the prerequisite reference data setup to the constructor for the test class.

Full Access
Question # 50

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

A.

Create all test data in the test class, use system. runs {} to invoke the trigger, then perform assertions.

B.

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

C.

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

D.

Create all test data in the test class, invoke Test.startTest{} and Test.etopTaat {} and then perform assertions.

Full Access