PD 2 Flashcards

1
Q

The Contact object has a custom field called “Zone.” Its data type is “Text” and field length is 3.
What is the outcome after executing the following code snippet in the org?
List<Contact> contactsToBeInserted=new List<Contact>(); Contact contactInstance= new Contact(LastName='Smith',
Department='Tech', Zone_c='IAD'); contactsToBeInserted.add(contactInstance); contactInstance= new Contact
(LastName='Sm1th', Department='Tech', Zone_c='PITT'); contactsToBeInserted.add(contactInstance); Database.insert
(contactsToBeInserted,true);
A. Both inserts succeed and the contact record that has the Zone value of 'PI'I'I' is set to NULL
B. A partial insert succeeds and the contact record that has the Zone value 'IAD' is inserted
C. Both inserts succeed and the contact record that has the Zone value of 'PITT' is truncated
D. An unhandled DML exception is thrown and no contact records are inserted</Contact></Contact>

A

D. An unhandled DML exception is thrown and no contact records are inserted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ABC Company has an Apex process that makes multiple extensive database operation and web service callouts. The database processes and web services can take a length time to run and must be run sequentially.

How should the developer write this Apex code without running into governor limits and system limitations?
Use Limits class to stop entire process once governor limits are reached.
Use multiple @future methods for each process and callout.
Use Queueable Apex to chain the jobs to run sequentially.
Use Apex Scheduler to scheduled each process.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order’s shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?
A. Use the apex:message tag to display errors
B. Use the aura:component tag to display errors
C. Use the ui:outputText tag to display errors
D. Use the ui:inputDefaultError tag to display errors

A

D. Use the ui:inputDefaultError tag to display errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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 now
B. Process Builder
C. Lightning web component
D. Apex method that returns a Continuation object

A

C. Lightning web component
D. Apex method that returns a Continuation object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the ways a developer can create test data of Contacts? (Choose two.)
A. myDataFactory.createContacts(10)
B. Test.createTestData ()
C. Test.loadTestRecords(Contact.sObjectType, ‘staticResource’)
D. Test.loadData(Contact.sObjectType, ‘staticResource’)

A

A. myDataFactory.createContacts(10)
D. Test.loadData(Contact.sObjectType, ‘staticResource’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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 dosed. 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 has not implemented seeAIIData-truwh the test method.
B. The test class has not re-queried the Account record after updating the Opportunity.
C. The test class has not defined an Account owner when inserting the test data.
D. The test class is not using System.runAs() to run tests as a Salesforce administrator.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)
A. HTTPCalloutMock
B. HTTPRequestMock
C. StaticResourceCalloutMock
D. HTTPResponseMock

A

A. HTTPCalloutMock
C. StaticResourceCalloutMock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which annotation exposes an Apex class as a RESTful web service?
A . RemoteAction.
B . HttpInvocable.
C . AuraEnabled.
D . RestResource.

A

D . RestResource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A developer created three Rollup Summary fields:

Total_timesheets_c, Total_Approved_timesheet_c and

Total_project_Timesheet_c in the custom object, project _c Now, the developer is tasked with created a new field to show the ratio between rejected and approved. what is two benefits using formula field instead of apex trigger

1.No test methods will be executed during deployment.

2.A test class that validates the formula field is needed for deployment.

3.Using a formula field reduces maintenance overhead.

4.A formula field will calculate the value retroactively for existing records

A

3.Using a formula field reduces maintenance overhead.

4.A formula field will calculate the value retroactively for existing records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance. When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created. What is the most extendable way to update the Apex Trigger to accomplish this?

A. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.
B. Add a Validation Rule to the Contract to prevent Contract creation by the user who loads the data.
C. Use a List Custom Setting to disable the trigger for the user who loads the data.
D. Add the Profile ID of the user who loads the data to the trigger so the trigger will not fire for this user.

A

A. Use a Hierarchy Custom Setting to skip executing the logic inside the trigger for the user who loads the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A developer is writing a complex application involving triggers, workflow rules, Apex classes, and processes. The developer needs to carefully consider the order of execution when developing the application.
1. Before Triggers
2. After Triggers
3. Post commit logic such as sending email
4. DML committed to the database
5. Workflow rules
6. Roll-up summary calculations
In what order do the following operations execute?
A. 1, 2, 5, 6, 4, 3
B. 1, 5, 6, 2, 4, 3
C. 1, 2, 4, 5, 6, 3
D. 1, 6, 5, 2, 4, 3

A

A. 1, 2, 5, 6, 4, 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses.
Which tool should the developer use?
A. Developer Console
B. Force.com Migration Tool
C. Workbench
D. Force.com IDE

A

C. Workbench

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A developer encounters an error that states that the Apex heap size is exceeded. Which technique may reduce heap size?

A. Add the transient keyword to the variable definition
B. Move the variable definition inside the scope of the function
C. Use static variables instead of instance variables
D. Use SOQL for loops instead of standard SOQL queries

A

D. Use SOQL for loops instead of standard SOQL queries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which interface needs to be implemented by a Lightning Component so that it may be
displayed in modal dialog by clicking a button on a Lightning Record page?
A. Lightning:editAction
B.Force:lightningQuickAction
C. Force:lightningEditAction
D. Fightning:quickAction

A

B.Force:lightningQuickAction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored.
Which options are valid? (Choose two.)
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled Jobs page in setup

A

A. Use the Apex Jobs page in setup
C. Query the AsyncApexJob record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A developer has been asked to create code that will meet the following requirements:
Receives input of: Map<Id, Project_c), List<Account>
Performs a potentially long-running callout to an outside web service
Provides a way to confirm that the process executed successfully
Which asynchronous feature should be used?
A. @future (callout=true)
B. Database.AllowCallouts interface
C. Schedulable interface
D. Queueable interface</Account>

A

D. Queueable interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree should be use to analyze events further starting from the one that take the least amount of time
C. The execution tree can be used with the execution log to filter and get specific information about events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time

A

A. Log lines in the execution log panel can be analyzed for details about specific events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A developer created the following test method:
The developer org has five accounts where the name starts with Test”. The developer executes this
test in the Developer Console.
After the test code runs, which statement is true?
A. The test will fail.
B. There will be five accounts where the name starts with Test”
C. There will be six accounts where the name starts with Test”.
D. There will be no accounts where the name starts with “Test”

A

B?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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?
Choose 2 answers
A. Implement the Queuable Interface in the class that contains the aggregate calculation method.
B. Use the areadOnly annotation on the method that performs the aggregate calculation.
C. Implement the schedulable Interface In the class that contains the aggregate calculation method.
D. Use the @future annotation on the method that performs the aggregate calculation.

A

A. Implement the Queuable Interface in the class that contains the aggregate calculation method.
C. Implement the schedulable Interface In the class that contains the aggregate calculation method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the transaction limit on the number of Apex jobs added to the queue?
A. 200
B. There is no limit
C. 50
D. 100
E. 150

A

C. 50

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A company has reference data stored in multiple Custom Metadata records that represent
default information for certain.
When a Contact is inserted, the default information should be set on the Contact from the Custom
Metadata records .. Address information.
What is the optimal way to automate this?
A. Apex Trigger
B. Process Builder
C. Visual Flow
D. Workflow Rule

A

B. Process Builder?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

If the “PageReference.setRedirect” Apex function is set to True, what type of request is
made?
A. Postback request
B. If PageReference points to the same controller and subset of extensions, postback request,
otherwise get request
C. Get request

A

C. Get request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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. Visualforce
B. Lightning Web Components
C. Aura Components
D. Lightning Experience Builder

A

A. Visualforce

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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 SI,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. Leave the business logic code Inside the trigger for efficiency.
B. Create a helper class that fetches the high value opportunities.
C. Call the trigger from the Lightning web component.
D. Use custom metadata to hold the high value amount.

A

B. Create a helper class that fetches the high value opportunities.
D. Use custom metadata to hold the high value amount.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

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/tree/
B. REST API request using composite/vbatch/
C. Bulk API 2.0
D. Apex web services

A

C. Bulk API 2.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which use case is an appropriate fit for the @future asynchronous Apex method? (Choose two.)
A. A developer has jobs that need larger query results than regular transactions allow
B. A developer needs to segregate DML operations and bypass the mixed save DML error
C. A developer has long-running jobs with large data volumes that need to be performed in batches
D. A developer has long-running methods and needs to prevent delaying an Apex transaction

A

B. A developer needs to segregate DML operations and bypass the mixed save DML error
D. A developer has long-running methods and needs to prevent delaying an Apex transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

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. Upload a third-party data table library as a static resource.
B. Use the transient keyword in the Apex code when querying the Account records.
C. Use the standard Account List controller and implement pagination.
D. Use JavaScript remoting to query the accounts.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?
A. List <Contact> contactList = new List <Contact>(); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
B. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
D. List <Contact> contactList = new List <Contact>(); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }</Contact></Contact></Id></Id></Contact></Contact></Id></Id></Contact></Contact></Contact></Contact>

A

C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }</Id></Id></Contact></Contact>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)
A. <apex:commandFunction></apex:commandFunction>
B. <apex:actionFunction></apex:actionFunction>
C. <apex:commandButton></apex:commandButton>
D. <apex:actionSupport></apex:actionSupport>

A

B. <apex:actionFunction></apex:actionFunction>
D. <apex:actionSupport></apex:actionSupport>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed.
How can the developer meet these requirements?
A. Use @Cache annotation
B. Use a StandardSetController
C. Use OFFSET in SOQL queries
D. Use OFFSET WITH CACHE in SOQL queries

A

B. Use a StandardSetController

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records.
How should the developer handle the recursive trigger?
A. Deactivate the trigger and move the logic into a Process or Flow
B. Deactivate the workflow rule to prevent the field update from executing
C. Use a static variable to prevent the trigger from executing more than once
D. Use a global variable to prevent the trigger from executing more than once

A

C. Use a static variable to prevent the trigger from executing more than once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

A developer has created a Visualforce page that uses a third-party JavaScript framework. The
developer has decided to supply data to the JavaScript functions using JavaScript Remoting for Apex
Controllers.
What is the correct syntax to declare a remote method in Apex? (Choose two.)
A. @RemoteObject global static String getTableQ
B. @RemoteAction public static String getTable()
C. @RemoteAction global static String getTable()
D. @RemoteAction global String getTable()

A

B. @RemoteAction public static String getTable()
C. @RemoteAction global static String getTable()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

An integration user makes a successful login() call via the SOAP API.
What can be used in the SOAP header to provide server authorization for subsequent API requests?
A. Security token
B. OAuth access token
C. Named Credentials
D. Session ID

A

D. Session ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records
B. Test methods must call the batch execute() method once
C. Test methods must use the @isTest (SeeAllData=true) annotation
D. Test methods must run the batch between Test.startTest() and Test.stopTest()

A

A. Test methods must execute the batch with a scope size of less than 200 records
D. Test methods must run the batch between Test.startTest() and Test.stopTest()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

https://www.freecram.net/question/Salesforce.PDII.v2020-06-24.q45/what-can-be-done-to-improve-the-performance-of-the-insert-trigger-shown-above

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

A custom object called Credit_Memo_c exist in a Salesforce environment. As part of a new feature
development that retrieves and manipulates this type of record, the developer needs to ensure race
conditions are prevented when a set of records are modified within an Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features
to prevent race condition within a transaction?

A

Memo Query end with for update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?

A. Use Javascript to move data processing to the browser instead of the controller.
B. Use the transient keywords for the List variables used in the custom controller.
C. Use lazy loading to load the data on demand, instead of the controller’s constructor.
D. Use an in the page to load all of the data asynchronously.

A

C. Use lazy loading to load the data on demand, instead of the controller’s constructor.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Universal Containers wants to use a Customer Community with Customer Community Plus licenses so their customers can track how many containers they are renting and when they are due back. Many of their customers are global companies with complex Account hierarchies, representing various departments within the same organization. One of the requirements is that certain community users within the same Account hierarchy be able to see several departments’ containers, based on a junction object that relates the Contact to the various Account records that represent the departments. Which solution solves these requirements?

A. A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records
B. A Custom List View on the junction object with filters that will show the proper records based on owner
C. A Custom Report Type and a report Lightning Component on the Community Home Page
D. An Apex Trigger that creates Apex Managed Sharing records based on the junction object’s relationships

A

C. A Custom Report Type and a report Lightning Component on the Community Home Page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Universal Containers wants to use an external Web Service provided by a third-party vendor to validate that shipping and billing addresses are correct. The current vendor uses basic password authentication, but Universal Containers might switch to a different vendor who uses OAuth.
What would allow Universal Containers to switch vendors without updating the code to handle authentication?
A. Custom Metadata
B. Custom Setting (List)
C. Dynamic Endpoint
D. Named Credential

A

D. Named Credential

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

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 Actions Tab
B. Salesforce Lightning Inspector Event Log Tab
C. Salesforce Lightning Inspector Transactions Tab
D. Salesforce Lightning Inspector Storage Tab

A

D. Salesforce Lightning Inspector Storage Tab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

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. 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. Remove the Database.setSavepoint and Database.rollback.
B. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.
C. Change the CalloutUtil.makeRestCallout to an @future method.
D. Move the CalloutUtil.makeRestCallout method call below the catch block.

A

C. Change the CalloutUtil.makeRestCallout to an @future method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field.

<apex:selectList>
<apex:selectOptions></apex:selectOptions>
</apex:selectList>

When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry.
What is the optimal way to implement this?
A. Add an <apex:actionFunction> within the <apex:selectOptions>.
B. Add an <apex:actionFunction> within the <apex:selectList>.
C. Add an <apex:actionSupport> within the <apex:selectList>.
D. Add an <apex:actionSupport> within the <apex:selectOptions>.</apex:selectOptions></apex:actionSupport></apex:selectList></apex:actionSupport></apex:selectList></apex:actionFunction></apex:selectOptions></apex:actionFunction>

A

C. Add an <apex:actionSupport> within the <apex:selectList></apex:selectList></apex:actionSupport>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

The test method above 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.setMock and Test.stopTest() after CalloutUtil.sendAccountUpdate.
B. Add Test.startTest() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.
C. Add if (!Test.isRunningTest()) around CalloutUtil.sendAccountUpdate.
D. Add Test.startTest() before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production.

What should the developer ensure to correct these errors?

A. Ensure queries do not exceed governor limits.

B. Ensure properties are marked as Transient.

C. Ensure properties are marked as private.
D. Ensure profiles have access to the Visualforce page.

A

B. Ensure properties are marked as Transient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

<lightning:layout multipleRows=”true”>
<lightning:layoutItem size=”12″>{!v.account.Name}
</lightning:layoutItem>

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

<lightning:layoutItem size=”12″>{!v.account.Industry}
</lightning:layoutItem>
</lightning:layout>

Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet.

Which option has the correct component changes to display correctly on desktops 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>

A

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>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

A company’s support process dictates that any time a Case is closed with a Status of ‘Could not 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 that creates the Engineering Review record and inserts it
B. A before update trigger that creates the Engineering Review record and inserts it
C. An after upsert trigger that creates the Engineering Review record and inserts it
D. A before upsert trigger that creates the Engineering Review record and inserts it

A

A. An after update trigger that creates the Engineering Review record and inserts it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

A company processes Orders within their Salesforce instance. When an Order’s status changes to ‘Paid’ it must notify the company’s order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?

A. Generate the Enterprise WSDL and use it to make a callout to the OMS.
B. Generate the Partner WSDL and use it to make a callout to the OMS.
C. Create an Outbound Message that contains the session ID and send it to the OMS.
D. Create an Apex trigger and make a callout to the OMS from the trigger.

A

C. Create an Outbound Message that contains the session ID and send it to the OMS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Consider the Apex controller above, that is called from a Lightning Aura Component.
What is wrong with it?
A. Line 1: class must be global
B. Lines 1 and 6: class and method must be global
C. Line 6: method must be static
D. Line 8: method must first serialize the list to JSON before returning

A

C. Line 6: method must be static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

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.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen. Which functionality consideration impacts the final decision?

A. Does the screen need to be rendered as a PDF?
B. Does the screen need to be accessible from the Lightning Experience UI?
C. Will the screen make use of a JavaScript framework?
D. Will the screen be accessed via a mobile app?

A

A. Does the screen need to be rendered as a PDF?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

A developer wishes to improve runtime performance of Apex calls by caching results on the client.
What is the best way to implement this?
A. Decorate the server-side method with @AuraEnabled(cacheable=true).
B. Set a cookie in the browser for use upon return to the page.
C. Call the setStorable() method on the action in the JavaScript client-side code.
D. Decorate the server-side method with @AuraEnabled(storable=true).

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

A developer is asked to update data in an org based on new business rules. The new rules state that Accounts with the type set to ‘Customer’ should have a status of ‘Active’, and Accounts with the type set to ‘Prospect’ should have a status of ‘Pending’. No other changes to data should be made.
Which code block will accurately meet the business requirements?
A. Map<String, String> statusMap = new Map<String, String>{‘Customer’=>’Active’, ‘Prospect’=>’Pending’} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;
B. Map<String, String> statusMap = new Map<String, String>{'Customer'=>'Active', 'Prospect'=>'Pending'} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account WHERE Status IN :statusMap.keySet()]){ a.Status = statusMap.get(a.Type); accountUpdates.add(a); } update accountUpdates;
C. List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( String.isNotBlank(a.Type) && a.Type == 'Customer' ){ a.Status = 'Active'; } if ( String.isNotBlank(a.Type) && a.Type == 'Prospect' ){ a.Status = 'Pending'; } accountUpdates.add(a); } update accountUpdades;
D. List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; accountUpdates.add(a); } update accountUpdates;</Account></Account></Account></Account></Account></Account></Account></Account>

A

A. Map<String, String> statusMap = new Map<String, String>{‘Customer’=>’Active’, ‘Prospect’=>’Pending’} List<Account> accountUpdates = new List<Account>(); for ( Account a : [SELECT Id, Type FROM Account]){ if ( statusMap.containsKey(a.Type) ) { a.Status = a.Type == 'Customer' ? 'Active' : 'Pending'; } accountUpdates.add(a); } update accountUpdates;</Account></Account>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available.
What change should be applied to the component?
A. Expose it in the markup using the implements and access attributes.
B. Delete the component, metadata, and Apex controller and recreate them.
C. Refresh the sandbox and upgrade it to the latest API version.
D. Look for errors in the logic in the JavaScript controller.

A

A. Expose it in the markup using the implements and access attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

What is a benefit of JavaScript remoting over Visualforce Remote Objects?
A. Allows for specified re-render targets
B. Does not require any Apex code
C. Does not require any JavaScript code
D. Supports complex server-side application logic

A

D. Supports complex server-side application logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

Recently a Salesforce org’s integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce.
The flow of data is as follows:
✑ The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds.
✑ If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds.
✑ If a match is not found, the integration will create a Lead and a Task for that newly created Lead.
What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?
A. Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24-hour period.
B. Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing.
C. Write a custom Apex web service that, given an email address, does all of the logic the integration code was doing.
D. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.

A

D. Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

A company wants to build a custom Lightning Component that will display a specified Account Field Set and that can only be added to the Account record page.
Which design resource configuration should be used?
A. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
B. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>
C. <design:component> <aura:attribute></aura:attribute> <sfdc:objects> <sfdc:object>FieldSet</sfdc:object> </sfdc:objects> </design:component>
D. <design:component> <aura:attribute></aura:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>

A

B. <design:component> <design:attribute></design:attribute> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration is periodically reporting errors.
Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?
A. Deactivate the Trigger before the Integration runs.

B. Use the Database method with allOrNone set to False.

C. Use a Try/Catch block after the insert statement.

D. Remove the Apex Class from the Integration User’s Profile.

A

B. Use the Database method with allOrNone set to False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

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 1 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. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements. Most Voted
B. 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.
C. There will be no error, since the limit on the number of records processed by DML statements is 50,000.
D. 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.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

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 a before insert trigger on Account to set the value of the required field.
B. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.
C. Change the required field to be a validation rule that excludes the System Administrator profile.
D. Add the required field to the data setup for all of the unit tests.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

A user receives the generic “An internal server error has occurred” while interacting with a custom Lightning Component.
What should the developer do to ensure a more meaningful message?
A. Add an onerror event handler to the tag.
B. Add an error-view component to the markup.
C. Use an AuraHandledException in a try/catch block.
D. Use ProcessBuilder to catch the error.

A

C. Use an AuraHandledException in a try/catch block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

global with sharing class MyRemoter {
public String accountName { get; set; }
public static Account account { get; set; }
public AccountRemoter() {}
@RemoteAction
global static Account getAccount(String accountName) {
account = [SELECT Id, Name, NumberOfEmployees
FROM Account WHERE Name = :accountName];
return account;
}
}
Consider the Apex class above that defines a RemoteAction used on a Visualforce search page.
Which code snippet will assert that the remote action returned the correct Account?
A. Account a = controller.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
B. MyRemoter remote = new MyRemoter(); Account a = remote.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
C. MyRemoter remote = new MyRemoter(‘TestAccount’); Account a = remote.getAccount (); System.assertEquals( ‘TestAccount’, a.Name );
D. Account a = MyRemoter.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );

A

D. Account a = MyRemoter.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page.
Which component should be added to the Visualforce page to display the message?
A. <apex:message></apex:message>
B. <apex:facet></apex:facet>
C. <apex:pageMessage></apex:pageMessage>
D. <apex:pageMessages></apex:pageMessages>

A

D. <apex:pageMessages></apex:pageMessages>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

A developer is writing code that requires making callouts to an external web service.
Which scenario necessitates that the callout be made in an @future method?

A. The callouts will be made in an Apex Trigger.
B. The callouts will be made in an Apex Test class.
C. The callout could take longer than 60 seconds to complete.
D. Over 10 callouts will be made in a single transaction.

A

A. The callouts will be made in an Apex Trigger.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

A developer wants to call an Apex Server-side Controller from a Lightning Aura Component.
What are two limitations to the data being returned by the Controller? (Choose two.)
A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
B. Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components.
C. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to.
D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.

A

A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.
D. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

Which interface needs to be implemented by a Lightning Component so that it may be displayed in modal dialog by clicking a button on a Lightning Record page?
A. force:lightningQuickAction
B. lightning:quickAction
C. lightning:editAction
D. force:lightningEditAction

A

A. force:lightningQuickAction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q

Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in
Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer.
The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and stored back in Salesforce.
What is the optimal solution?
A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce
B. An Apex trigger that upon saving the Order will make a real-time Apex callout, saving the pricing back in Salesforce
C. A Process Builder process and Outbound Message to fetch the pricing upon save and store the pricing in Salesforce
D. An ETL tool to process batches of newly saved Orders every few minutes to store the pricing back in Salesforce

A

A. A Visualforce page that can make a real-time Apex callout to display and save the pricing back in Salesforce

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

What are three benefits of using declarative customizations over code? (Choose three.)
A. Declarative customizations cannot generate run time errors.
B. Declarative customizations will automatically update with each Salesforce release.
C. Declarative customizations do not require user testing.
D. Declarative customizations are not subject to governor limits.
E. Declarative customizations generally require less maintenance.

A

B D E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q

Which use case can only be performed by using asynchronous Apex?
A. Scheduling a batch process to complete in the future
B. Processing high volumes of records
C. Updating a record after the completion of an insert
D. Calling a web service from an Apex trigger

A

D. Calling a web service from an Apex trigger

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

@isTest
static void testIncrement() {
Account acct = new Account(Name = ‘Test’);
acct.Number_Of_Times_Viewed__c = 0;
insert acct;
AuditUtil.incrementViewed(acct.Id);
Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0]
System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);
}
The test method above 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 initialization to acct.Number_Of_Times_Viewed__c = 1.
B. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.
C. Add Test.startTest() before and Test.stopTest() after insert acct.
D. Change the assertion to System.assertEquals(0, acctAfter.Number_Of_Times_Viewed__c).

A

B. Add Test.startTest() before and Test.stopTest() after AuditUtil.incrementViewed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order__c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account.
What is the optimal way to implement this?
A. Perform a REST GET on the Account and a REST POST to update the Order__c with the Account’s record ID.
B. Perform a REST PATCH to upsert the Order__c and specify the Account’s Customer_Number__c in it.
C. Perform a REST POST to update the Order__c and specify the Account’s Customer_Number__c in it.
D. Perform a REST GET on the Account and a REST PATCH to upsert the Order__c with the Account’s record ID.

A

B. Perform a REST PATCH to upsert the Order__c and specify the Account’s Customer_Number__c in it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

What are three benefits of using static resources in Visualforce and Lightning Components? (Choose three.)
A. Static resource files are automatically minified.
B. Static resource files can be referenced by using the $Resource global variable instead of hardcoded IDs.
C. Static resource files can be packaged into a collection of related files in a zip or jar archive.
D. Static resource files do not count against an organization’s quota of data storage.
E. Relative paths can be used in files in static resource archives to refer to other content within the archive.

A

B C E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

A company has a native iOS app for placing orders 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?
A. Apex REST Web Service
B. Apex SOAP Web Service
C. Apex SOAP Callout
D. Apex REST Callout

A

A. Apex REST Web Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
73
Q

A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an
Opportunity’s Probability is greater than 50%.
What is the optimal way to automate this?
A. Use an Apex Trigger on Opportunity.
B. Build a Flow on Opportunity. Most Voted
C. Create a Workflow on Opportunity.
D. Build a Process on Opportunity.

A

B. Build a Flow on Opportunity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
74
Q

A company represents their customers as Accounts in Salesforce. All customers have a unique Customer_Number__c that is unique across all of the company’s systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time.
What is the optimal way to implement this?
A. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.
B. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice.
C. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly.
D. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code.

A

A. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
75
Q

An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders.
What is the optimal method for a developer to troubleshoot this?
A. Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions.
B. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error.
C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.
D. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage.

A

C. Add system.debug() statements to the code and use the Developer Console logs to trace the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
76
Q

A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?
A. Create a Process, call an Apex @future(callout=true) method from it, and make the callout from that Apex method.
B. Create a Process, call an Apex @InvocableMethod from it, and make the callout from that Apex method.
C. Create an after insert trigger, call an Apex @InvocableMethod method from it, and make the callout from that Apex method.
D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.

A

D. Create an after insert trigger, call an @future(callout=true) method from it, and make the callout from that Apex method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
77
Q

Which statement should be used to allow some of the records in a list of records to be inserted if others fail to be inserted?
A. insert (records, false)
B. Database.insert(records, false)
C. Database.insert(records, true)
D. insert records

A

B. Database.insert(records, false)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
78
Q

Which two relationship queries use the proper syntax? (Choose two.)
A. SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry = ‘Media’
B. SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account
C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = ‘Media’

A

C. SELECT Name, (SELECT LastName FROM Contacts) FROM Account
D. SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = ‘Media’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
79
Q

A developer built a Component to be used at the front desk for quests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk.
What should be used?
A. Application Event
B. DML Operation
C. Component Event
D. ChangeLog

A

A. Application Event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
80
Q

Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity’s Account?
A. List <Contact> contactList = new List <Contact>(); for(Opportunity o : opportunityList){ Account a = [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id = :o.AccountId] contactList.addAll(a.Contacts); )
B. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for (Opportunity o : opportunityList){ contactIds.add(o.ContactId); } for(Contact c : [SELECT Id FROM Contact WHERE Id IN :contactIds]){ contactList.add(c); }
C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }
D. List <Contact> contactList = new List <Contact>(); for ( Contact c : [SELECT Id FROM Contact WHERE AccountId IN :opportunityList.AccountId] ){ contactList.add(c); }</Contact></Contact></Id></Id></Contact></Contact></Id></Id></Contact></Contact></Contact></Contact>

A

C. List <Contact> contactList = new List <Contact>(); Set <Id> accountIds = new Set <Id> (); for(Opportunity o : opportunityList){ accountIds.add(o.AccountId); } for(Account a : [SELECT Id, (SELECT Id FROM Contacts) FROM Account WHERE Id IN :accountIds]){ contactList.addAll(a.Contacts); }</Id></Id></Contact></Contact>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
81
Q

An Apex Trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records is loaded, the Apex Trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex Trigger to accomplish this?
A. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.
B. Use a List Custom Setting to disable the Trigger for the user who does the data loading.
C. Add the Profile Id of the user who does the data loading to the Trigger so the Trigger won’t fire for this user.
D. Add a Validation Rule to the Contract to prevent Contract creation by the user who does the data loading.

A

A. Use a Hierarchy Custom Setting to disable the Trigger for the user who does the data loading.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
82
Q

Business rules require a Contact to 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 the Database.Delete method if the Contact insertion fails.
B. Use the Database.Insert method with allOrNone set to False.
C. Disable Validation rules on Contacts and set default values with a Trigger.
D. Use setSavePoint() and rollback() with a try/catch block.

A

D. Use setSavePoint() and rollback() with a try/catch block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
83
Q

trigger AssignOwnerByRegion on Account ( before insert, before update )
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region\_\_c theRegion = [
SELECT Id, Name, Region_Manager\_\_c</Account></Account>

FROM Region__c -
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account’s region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)
A. Use a Map to cache the results of the Region__c query by Id.
B. Move the Region__c query to outside the loop.
C. Remove the last line updating accountList as it is not needed.
D. Use a Map accountMap instead of List accountList.

A

B. Move the Region__c query to outside the loop.
C. Remove the last line updating accountList as it is not needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
84
Q

Example 1:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘expr0’));
}
Example 2:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get(‘theAverage’));
}
Example 3:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug(‘Average amount’ + ar.get.AVG());
}
Example 4:
AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResults)
{
System.debug(‘Campaign ID’ + ar.get(‘CampaignId’));
System.debug (‘Average amount’ + ar.theAverage);
}
Which two of the examples above have correct System.debug statements? (Choose two.)
A. Example 1
B. Example 2
C. Example 3
D. Example 4

A

A. Example 1
B. Example 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
85
Q

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

A

A. Date.format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
86
Q

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;

A

B. upsert orders Order_Number__c;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
87
Q

A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated in Salesforce with new Owners when the territory assignments are completed in the external system.
What is the optimal way to update the Accounts from the external system?
A. Bulk API
B. SOAP API
C. Apex REST Web Service
D. Composite REST API

A

A. Bulk API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
88
Q

A company wants to implement a new call center process for handling customer service calls. It requires service reps to ask for the caller’s account number before proceeding with the rest of their call script.
Following best practices, what should a developer use to meet this requirement?
A. Apex Trigger
B. Process Builder
C. Flow Builder
D. Approvals

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
89
Q

What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?
A. Use the Schema namespace.
B. Use a static resource.
C. Perform a callout to the Metadata API.
D. Perform a SOQL Query.

A

A. Use the Schema namespace.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
90
Q

A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it.
Which method of integration is optimal?
A. REST API
B. Apex SOAP Web Service
C. Soap API
D. Apex REST Web Service

A

D. Apex REST Web Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
91
Q

A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Also, Workflows that once sent emails and created tasks no longer do so. Which two statements are true regarding these issues and resolution? Choose 2 answers
A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.

B. The administrators are deploying their own Change Sets, thus deleting each other’s fields from the objects in production.

C. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production

D. Page Layouts should never be deployed via Change Sets, as this causes Workflows and Field-level Security to be reset and fields to disappear.

A

A. A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production.
C. The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
92
Q

A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page.
Which feature of Apex code is required to facilitate this solution?
A. SOSL queries
B. describeSObjects()
C. Dynamic Schema binding
D. REST API

A

B. describeSObjects()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
93
Q

Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b.
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__b 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__b WHERE Account__c = ‘001R000000302D3’ AND Program__c =’Shoppers’ AND Transaction_Date__c=2019-05-31T00:00Z
B. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c LIKE ‘Shop%’ AND Transaction_Date__c=2019-05-31T00:00Z
C. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c INCLUDES (‘Shoppers’, ‘Womens’) AND Transaction_Date__c=2019-05-31T00:00Z
D. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c EXCLUDES (‘Shoppers’, ‘Womens’) AND Transaction_Date__c=2019-05-31T00:00Z

A

A. SELECT Account__c, Program__c, Transaction_Date__c FROM Customer_Transaction__b WHERE Account__c = ‘001R000000302D3’ AND Program__c =’Shoppers’ AND Transaction_Date__c=2019-05-31T00:00Z

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
94
Q

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. SUM() SOQL aggregate query on the Opportunity object
C. SOQL for loop that counts the number of Opportunities records
D. COUNT() SOQL aggregate query on the Opportunity object

A

D. COUNT() SOQL aggregate query on the Opportunity object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
95
Q

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. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method.
B. Move the prerequisite reference data setup to a @testSetup method in the test class.
C. Move the prerequisite reference data setup to a static method in the test class and call that from each test method.
D. Move the prerequisite reference data setup to the constructor for the test class.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
96
Q

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 all Workflow Rules have fired.
What is the optimal way to accomplish this?
A. Use a MassEmailMessage() with an Apex Trigger.
B. Use a Workflow Email Alert.
C. Use an Email Alert with Process Builder.
D. Use a SingleEmailMessage() with an Apex Trigger.

A

C. Use an Email Alert with Process Builder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
97
Q

UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won.
What is the optimal solution for UC Loans to accomplish this?
A. Process Builder
B. Quick Action
C. Workflow Rule
D. Apex Trigger

A

A. Process Builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
98
Q

A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call.
Which feature should be used to implement these requirements?
A. @future
B. Queueable
C. Process Builder
D. Workflow

A

C. Process Builder

99
Q

A developer gets an error saying ‘Maximum Trigger Depth Exceeded’.
What is a possible reason to get this error message?
A. The SOQL governor limits are being hit.
B. A process Builder is running that sends mass emails.
C. There are numerous DML operations in the trigger logic.
D. A trigger is recursively invoked more than 16 times.

A

D. A trigger is recursively invoked more than 16 times.

100
Q

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called ‘Is Primary’ to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.
What is the optimal way to implement these requirements?
A. Write an after update trigger on Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.
B. Write a Validation Rule on the Contact for the Is Primary logic and a before update trigger on Contact for the last name logic.
C. Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.
D. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.

A

D. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.

101
Q

A developer is trying to access org data from within a test class.
Which sObject type requires the test class to have the (seeAllData=true) annotation?
A. Report
B. User
C. Profile
D. RecordType

A

A. Report

102
Q

The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored.
Which options are valid? (Choose two.)
A. Use the Apex Jobs page in setup
B. Query the Queueable Apex record
C. Query the AsyncApexJob record
D. Use the Scheduled Jobs page in setup

A

A. Use the Apex Jobs page in setup
C. Query the AsyncApexJob record

103
Q

Which are relevant practices while analyzing the timeline of different types of transactions in the execution overview panel? (Choose two.)
A. Log lines in the execution log panel can be analyzed for details about specific events
B. The performance tree should be use to analyze events further starting from the one that take the least amount of time
C. The execution tree can be used with the execution log to filter and get specific information about events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time

A

A. Log lines in the execution log panel can be analyzed for details about specific events
D. Multiple short bursts of Apex events should be analyzed since they can add up to a significant amount of time

104
Q

A developer is writing a complex application involving triggers, workflow rules, Apex classes, and processes. The developer needs to carefully consider the order of execution when developing the application.
1. Before Triggers
2. After Triggers
3. Post commit logic such as sending email
4. DML committed to the database
5. Workflow rules
6. Roll-up summary calculations
In what order do the following operations execute?
A. 1, 2, 5, 6, 4, 3
B. 1, 5, 6, 2, 4, 3
C. 1, 2, 4, 5, 6, 3
D. 1, 6, 5, 2, 4, 3

A

A. 1, 2, 5, 6, 4, 3

105
Q

A developer has been asked to create code that will meet the following requirements:
Receives input of: Map<Id, Project_c), List<Account>
Performs a potentially long-running callout to an outside web service
Provides a way to confirm that the process executed successfully
Which asynchronous feature should be used?
A. @future (callout=true)
B. Database.AllowCallouts interface
C. Schedulable interface
D. Queueable interface</Account>

A

D. Queueable interface

106
Q

A developer wants to retrieve and deploy metadata, perform simple CSV export of query results, and debug Apex REST calls by viewing JSON responses.
Which tool should the developer use?
A. Developer Console
B. Force.com Migration Tool
C. Workbench
D. Force.com IDE

A

C. Workbench

107
Q

What is a best practice when unit testing a controller? (Choose two.)
A. Simulate user interaction by leveraging Test.setMock()
B. Verify correct references by using getURL()
C. Access test data by using seeAllData=true
D. Set query parameters by using getParameters().put

A

B. Verify correct references by using getURL()
D. Set query parameters by using getParameters().put

108
Q

A developer is working on code that requires a call to an external web service from a batch.
How should the developer enable this functionality?
A. Implement a custom System.CalloutException class
B. Include Database.AllowCallout() in the class definition
C. Implement an @future method for the callout, and invoke it from the batch
D. Specify “callout=true” in the batch implementation

A

B. Include Database.AllowCallout() in the class definition

109
Q

A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.
How can the developer meet these requirements? (Choose two.)
A. Use a StandardSetController
B. Use CURSOR 50 in SOQL queries
C. Use OFFSET in SOQL queries
D. Use LIMIT 50 in SOQL queries

A

C. Use OFFSET in SOQL queries
D. Use LIMIT 50 in SOQL queries

110
Q

A developer must create a way for external partners to submit millions of leads into Salesforce per day.
How should the developer meet this requirement?
A. Publicly expose a Visualforce page via Force.com Sites
B. Create a web service on Heroku that uses Heroku Connect
C. Host a Web-to-Lead form on the company website
D. Publicly expose an Apex Web Service via Force.com Sites

A

B. Create a web service on Heroku that uses Heroku Connect

111
Q

Which is a valid Apex REST Annotation? (Choose two.)
A. @HttpPatch
B. @HttpDelete
C. @HttpUpsert
D. @HttpAction

A

A. @HttpPatch
B. @HttpDelete

112
Q

A customer requires that when the billing address field on an Account gets updated, the address field on all its related contact records should reflect the same update.
How can this requirement be met with minimal customizations?
A. Create an After Trigger on Account to update its related contact records on update
B. Create a Workflow Rule on Account to update related child Contact records
C. Create a Lightning Process on Account to update related child Contact records
D. Create a scheduled batch job that updates all contact address fields based on the related account record

A

C. Create a Lightning Process on Account to update related child Contact records

113
Q

A company requires an external system to be notified whenever an account is updated. trigger AccountTrigger on Account (after update){ for (Account updatedAccount:Trigger.new)
{ AccountTriggerHelper.notinyxternalSystem(updatedAccount.id); } } public class AccountTriggerHelperfuture(callout=true)
{ public static void notinyxternalSystem(Id accountId){ Account acc = [Select id, name from Account where accountId =
:accountId]; http objectHttp h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint(‘http://example.org/ restService’); req.setMethod(‘POST’); req.setBody(JSON.serialize(acc)); HttpResponse res = h.send(req); } }
What LimitException could the following code trigger?
A. System.LimitException: Too many future calls
B. System.LimitException: Too many callouts
C. System.LimitException: Too many SOQL queries
D. System.CalloutException: Callout from triggers are currently not supported

A

A. System.LimitException: Too many future calls

114
Q

A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action.
How can the developer accomplish this?
A. Use <apex:actionFunction> to create a JavaScript wrapper for the controller method
B. Use the @RemoteAction annotation on the method definition with JavaScript Remoting
C. Use the $Controller global variable to access the controller method via JavaScript
D. Use <apex:actionSupport> to enable JavaScript support for the controller method</apex:actionSupport></apex:actionFunction>

A

B. Use the @RemoteAction annotation on the method definition with JavaScript Remoting

115
Q

A company exposes a REST web service and wants to establish two-way SSL between Salesforce and the REST web service. A certificate signed by an appropriate certificate authority has been provided to the developer.
What modification is necessary on the Salesforce side? (Choose two.)
A. Create an entry for the certificate in Certificate and Key Management
B. Update the code to use HttpRequest.setClientCertificateName()
C. Configure two-factor authentication with the provided certificate
D. Update the code to use HttpRequest.setHeader() to set an Authorization header

A

A. Create an entry for the certificate in Certificate and Key Management
B. Update the code to use HttpRequest.setClientCertificateName()

116
Q

What is a consideration when using bind variables with dynamic SOQL? (Choose two.)
A. Dynamic SOQL cannot reference fields on bind variables
B. Dynamic SOQL cannot use bind variables
C. Bind variables must be public or global
D. Bind variables must be in local scope

A

A. Dynamic SOQL cannot reference fields on bind variables
D. Bind variables must be in local scope

117
Q

A developer created a custom component to display an HTML table. The developer wants to be able to use the component on different Visualforce Pages and specify different header text for the table.
Which tag should the developer use inside the component?
A. <apex:variable>
B. <apex:define>
C. <apex:param>
D. <apex:attribute></apex:attribute></apex:param></apex:define></apex:variable>

A

D. <apex:attribute></apex:attribute>

118
Q

Which two objects can be inserted in the same transaction? (Choose two.)
A. Opportunity and User
B. Account and AccountShare
C. Case and CaseComment
D. Account and Group

A

B. Account and AccountShare
C. Case and CaseComment

119
Q

How can the DISTANCE and GEOLOCATION functions be used in SOQL queries? (Choose two.)
A. To filter results based on distance from a latitude and longitude
B. To get the distance results from a latitude and longitude
C. To order results by distance from a latitude or longitude
D. To group results in distance ranges from a latitude and longitude

A

A. To filter results based on distance from a latitude and longitude
C. To order results by distance from a latitude or longitude

120
Q

A developer has created a solution using the SOAP API for authenticating Communities users.
What is needed when issuing the login() Call? (Choose two.)
A. Organization Id
B. Session Id
C. Username and Password
D. Security Token

A

C. Username and Password
D. Security Token

121
Q

When developing a Visualforce page that will be used by a global organization that does business in many languages and many currencies, which feature should be used? (Choose three.)
A. Custom Labels
B. convertCurrency()
C. Global Labels
D. Translation Workbenc
E. getLocalCurrency()

A

A. Custom Labels
B. convertCurrency()
D. Translation Workbenc

122
Q

A developer needs test data for Apex test classes.
What can the developer use to provide test data to the test methods? (Choose two.)
A. List<sObject> Is = Test.loadData (Lead.sObjectType, 'myTestLeads');
B. myDataFactory.createTestRecords (10)
C. Database.createTestRecords (10)
D. List<sObject> Is = Test.loadDat (Lead.sObjectType, $Resource + 'myTestLeads');</sObject></sObject>

A

A. List<sObject> Is = Test.loadData (Lead.sObjectType, 'myTestLeads');
B. myDataFactory.createTestRecords (10)</sObject>

123
Q

[FIND ‘map’ IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead]
What is a valid return type for the following SOSL query?
A. List<sObject>
B. List<List<sObject>>
C. List<AggregateResult>
D. List<Account></Account></AggregateResult></sObject></sObject>

A

B. List<List<sObject>></sObject>

124
Q

What level can a hierarchy custom setting be defined for? (Choose three.)
A. Users
B. Groups
C. Profiles
D. Roles
E. Organization

A

ACE

125
Q

A developer has created a Visualforce page that uses a third-party JavaScript framework. The developer has decided to supply data to the JavaScript functions using JavaScript Remoting for Apex Controllers.
What is the correct syntax to declare a remote method in Apex? (Choose two.)
A. @RemoteAction global static String getTable()
B. @RemoteAction global String getTable()
C. @RemoteAction public static String getTable()
D. @RemoteObject global static String getTable()

A

A. @RemoteAction global static String getTable()
C. @RemoteAction public static String getTable()

126
Q

Which API can be used to execute unit tests? (Choose three.)
A. Streaming API
B. Test API
C. Tooling API
D. SOAP API
E. Metadata API

A

C. Tooling API
D. SOAP API
E. Metadata API

127
Q

Which statement is true about using ConnectApi namespace (also called Chatter in Apex)? (Choose two.)
A. Chatter in Apex methods honor the ‘with sharing’ and ‘without sharing’ keywords
B. Chatter in Apex operations are synchronous, and they occur immediately
C. Chatter in Apex methods do not run in system mode; they run in the context of the current user
D. Many test methods related to Chatter in Apex require the IsTest (SeeAllData=true) annotation

A

C. Chatter in Apex methods do not run in system mode; they run in the context of the current user
D. Many test methods related to Chatter in Apex require the IsTest (SeeAllData=true) annotation

128
Q

A developer receives a LimitException: Too many query rows: 50001 error when running code.
What debugging approach using the Developer Console provides the fastest and most accurate mechanism to identify a specific component that may be returning an unexpected number of rows?
A. Count the number of Row Limit warning messages in the Debug Logs
B. Add System.debug(System.getQueryRows()) to the code to track SOQL usage
C. Filter the Debug Log on SOQL_EXECUTE_END statements to track the results of each SOQL Query
D. Use the Execution Overview to see the number of rows returned by each Executed Unit

A

C. Filter the Debug Log on SOQL_EXECUTE_END statements to track the results of each SOQL Query

129
Q

A developer is writing a Visualforce page to display a list of all of the checkbox fields found on a custom object.
What is the recommended mechanism the developer should use to accomplish this?
A. Schema Class
B. Apex API
C. Schema Builder
D. Metadata API

A

A. Schema Class

130
Q

A developer has created a Team Member sObject that has a Master-Detail relationship to a Project sObject and a Lookup relationship to the User sObject. The developer must ensure that a User listed on a Team Member record has Read-Write access to the parent Project record.
How can the developer accomplish this if the Project sObject has a Private sharing model and thousands of Project records?
A. Create a Controller that uses the Without Sharing keyword
B. Create a Criteria-Based Sharing Rule on the Project sObject
C. Create a Team Member Trigger that inserts Project_Share records
D. Create a Project Sharing Rule that shares to the Team Member Group

A

C. Create a Team Member Trigger that inserts Project_Share records

131
Q

1 Contact con = new Contact( LastName =’Smith’, Department = ‘Admin’)
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = ‘HR’;
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?
A. 5
B. 3
C. 4
D. 2

A

C. 4

132
Q

What is a recommended practice with regard to the Apex CPU limit? (Choose two.)
A. Optimize SOQL query performance
B. Use Map collections to cache sObjects
C. Avoid nested Apex iterations
D. Reduce view state in Visualforce pages

A

B. Use Map collections to cache sObjects
C. Avoid nested Apex iterations

133
Q

A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user.
How can this be accomplished? (Choose two.)
A. Use the (apex: information) tag to display the error message
B. Use the ApexPages.addMessage() method to add the error message
C. Use the <apex:pageMessages> tag to display the error message
D. Use the account.addError() method to add the error message</apex:pageMessages>

A

B. Use the ApexPages.addMessage() method to add the error message
C. Use the <apex:pageMessages> tag to display the error message</apex:pageMessages>

134
Q

A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly.
What will improve performance? (Choose three.)
A. Reducing the view state
B. Using actionRegion and rerender
C. Turning off the standard stylesheet
D. Setting the Apex Page attribute cache=true
E. Using selective queries

A

A. Reducing the view state
D. Setting the Apex Page attribute cache=true
E. Using selective queries

135
Q

A developer writes the following Apex trigger so that when a Case is closed, a single Survey record is created for that Case. The issue is that multiple Survey_c records are being created per Case. trigger CaseTrigger on Case (after insert, after update){ List<Survey_c> createSurveys = new List<Survey_c>(); for (Case c : trigger.new){ if (c.IsClosed && (trigger.isInsert II trigger.isUpdate && trigger.oldMap.get(c.Id).IsClosed == false)){ createSurveys.add(new Survey_c(Case_c = c.Id)); } } insert createSurveys; }
What could be the cause of this issue?
A. A user is creating the record as Closed
B. A workflow rule is firing with a Create Task action
C. A workflow rule is firing with a Field Update action
D. A user is editing the record multiple times</Survey_c></Survey_c>

A

D. A user is editing the record multiple times

136
Q

What is a potential design issue with the following code?
trigger accountTrigger on Account (before update){ Boolean processOpportunity = false; List<opportunity> opptysClosedLost = new List<opportunity>() List<opportunity> IstAllOpp = [select StageName from Opportunity where accountId IN :Trigger.newMap.keySet()]; if(!IstAllOpp.isEmpty()) processOpportunity = true; while(processOpportunity)
{ for(opportunity o : IstAllOpp) if(o.StageName == 'Closed - Lost') opptysClosedLost.add(o); processOpportunity = false; if(!opptysClosedLost.isEmpty()) delete opptysClosedLost;
A. SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity
B. The code will result in a System.LimitException : Too many script statements error
C. The code will result in a System.DmlException:Entity_is_Deleted error
D. The code will result in a System.LimitException: Apex CPU time limit exceeded error</opportunity></opportunity></opportunity>

A

D. The code will result in a System.LimitException: Apex CPU time limit exceeded error

137
Q

Which statement is true regarding the use of user input as part of a dynamic SOQL query?
A. Free text input should not be allowed, to avoid SOQL injection
B. The String.format() method should be used to prevent injection
C. Quotes should be escaped to protect against SOQL injection
D. The string should be URL encoded by the input form to prevent errors

A

C. Quotes should be escaped to protect against SOQL injection

138
Q

A developer has written the following method:
static void processList(List<sobject> input){
Which code block can be used to call the method?
A. processList (acc)
B. processList ([FIND 'Acme" 'RETURNING Account])
C. processList([SELECT Id, Name FROM sObject WHERE Type = 'Account'])
D. for Account acc : [SELECT Id, Name FROM Account])</sobject>

A

C. processList([SELECT Id, Name FROM sObject WHERE Type = ‘Account’])

139
Q

A developer needs to design a custom object that will be integrated into a back-end system.
What should the developer do to ensure good data quality and to ensure that data imports, integrations, and searches perform well? (Choose two.)
A. Configure a custom field as unique
B. Configure a custom field as indexed
C. Configure a custom field as external ID
D. Configure a custom field as Salesforce ID

A

A. Configure a custom field as unique
C. Configure a custom field as external ID

140
Q

A developer encounters an error that states that the Apex heap size is exceeded.
Which technique may reduce heap size?
A. Add the transient keyword to the variable definition
B. Move the variable definition inside the scope of the function
C. Use static variables instead of instance variables
D. Use SOQL for loops instead of standard SOQL queries

A

D. Use SOQL for loops instead of standard SOQL queries

141
Q

A developer has a Debug method within a class, which is invoked hundreds of times.
What is the optimal functionality in the Developer Console to count the number of calls made to the method?
A. The “Execution Log” Panel
B. The “Execution Stack” Panel
C. The “Executed Units” tab under the Execution Overview Panel
D. The “Execution Tree” tab under the Stack Tree Panel

A

C. The “Executed Units” tab under the Execution Overview Panel

142
Q

What is a consideration when testing batch Apex? (Choose two.)
A. Test methods must execute the batch with a scope size of less than 200 records
B. Test methods must call the batch execute() method once
C. Test methods must use the @isTest (SeeAllData=true) annotation
D. Test methods must run the batch between Test.startTest() and Test.stopTest()

A

A. Test methods must execute the batch with a scope size of less than 200 records
D. Test methods must run the batch between Test.startTest() and Test.stopTest()

143
Q

A developer is building a Visualforce page that interacts with external services.
Which interface should the developer implement to test this functionality? (Choose two.)
A. HTTPCalloutMock
B. HTTPRequestMock
C. HTTPResponseMock
D. StaticResourceCalloutMock

A

A. HTTPCalloutMock
D. StaticResourceCalloutMock

144
Q

A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of “1” for a: Exec_Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account: trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update){ for (Account accountInstance: Trigger.New){ if (Trigger . isBefore){ accountInstance Exec_Count_c += 1; } System. debug
(accountInstance.Exec_Count_c); } }
A. 1, 2, 3, 3
B. 1, 2, 3, 4
C. 2, 2, 4, 4
D. 2, 2, 3, 3

A

C. 2, 2, 4, 4

145
Q

A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order’s shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?
A. Use the apex:message tag to display errors
B. Use the aura:component tag to display errors
C. Use the ui:outputText tag to display errors
D. Use the ui:inputDefaultError tag to display errors

A

D. Use the ui:inputDefaultError tag to display errors

146
Q

A developer needs to create a service that will process an email sent to it and create an account and contact using the contents of the email as data for the records.
How might a developer accomplish this requirement?
A. Use the Apex Inbound Email Handler
B. Use the Fuel API with Email Data Extensions
C. Use Heroku Data Clips to Process Email
D. Use Auto-launched Flow and Process Builder

A

A. Use the Apex Inbound Email Handler

147
Q

How can Apex be used with Visual Workflow?
A. To set the version of a Flow being run
B. To start a Flow automatically
C. To add custom styling to a Flow
D. To control access to a Flow

A

B. To start a Flow automatically

148
Q

An integration user makes a successful login() call via the SOAP API.
What can be used in the SOAP header to provide server authorization for subsequent API requests?
A. Named Credentials
B. Session ID
C. OAuth access token
D. Security token

A

B. Session ID

149
Q

A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits.
What are three recommendations to optimize page performance? (Choose three.)
A. Segregate calculation functionality from input functionality
B. Specify the list of sales forecasts as transient
C. Implement pagination and reduce records per page
D. Create formula fields to compute pivoted forecast calculations
E. Use JavaScript Remoting instead of controller actions

A

A. Segregate calculation functionality from input functionality
C. Implement pagination and reduce records per page
E. Use JavaScript Remoting instead of controller actions

150
Q

A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)
A. Surround the callout with Test.startTest(), Test.stopTest()
B. Surround the data insertion with Test.startTest(), Test.stopTest()
C. Implement the WebServiceMock interface
D. Update code to call Test.setMock()
E. Implement the HttpCalloutMock interface

A

A. Surround the callout with Test.startTest(), Test.stopTest()
C. Implement the WebServiceMock interface
D. Update code to call Test.setMock()

151
Q

A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication.
What code should the developer use to authenticate?
A. Http.setHeader (‘Authorization’ , ‘Basic QthZGprjpchVulHNchFtZQ’)
B. stub.inputHttpHeaders_x.put(‘Authorization’ , ‘Basic QthZGprjpchVulHNchFtZQ’)
C. Http.setAuthentication(‘Basic QthZGprjpchVulHNchFtZQ’)
D. stub.authentication.put (‘Authorization’,’Basic QthZGprjpchVulHNchFtZQ’)

A

B. stub.inputHttpHeaders_x.put(‘Authorization’ , ‘Basic QthZGprjpchVulHNchFtZQ’)

152
Q

What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)
A. <apex:commandFunction></apex:commandFunction>
B. <apex:actionFunction></apex:actionFunction>
C. <apex:commandButton></apex:commandButton>
D. <apex:actionSupport></apex:actionSupport>

A

B. <apex:actionFunction></apex:actionFunction>
D. <apex:actionSupport></apex:actionSupport>

153
Q

A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed.
How can the developer meet these requirements?
A. Use @Cache annotation
B. Use a StandardSetController
C. Use OFFSET in SOQL queries
D. Use OFFSET WITH CACHE in SOQL queries

A

B. Use a StandardSetController

154
Q

Which use case is an appropriate fit for the @future asynchronous Apex method? (Choose two.)
A. A developer has jobs that need larger query results than regular transactions allow
B. A developer needs to segregate DML operations and bypass the mixed save DML error
C. A developer has long-running jobs with large data volumes that need to be performed in batches
D. A developer has long-running methods and needs to prevent delaying an Apex transaction

A

B. A developer needs to segregate DML operations and bypass the mixed save DML error
D. A developer has long-running methods and needs to prevent delaying an Apex transaction

155
Q

A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records.
How should the developer handle the recursive trigger?
A. Deactivate the trigger and move the logic into a Process or Flow
B. Deactivate the workflow rule to prevent the field update from executing
C. Use a static variable to prevent the trigger from executing more than once
D. Use a global variable to prevent the trigger from executing more than once

A

C. Use a static variable to prevent the trigger from executing more than once

156
Q

A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price.
What must be added to display the total?
A. Add Total: {quantity * UnitPrice} in the template.

B. Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template.

C. Add Total; {multiple quantit,y unitprice)} in the template.

D. Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template.

A

D. Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template.

157
Q

. Universal Containers stores user preferences in a Hierarchy Custom Setting, User_prefs_c, with a Checkbox field, show_Help_c, 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?
Boolean show = User_Prefs_c, getinstance( ), Show_Help _c;
Boolean show = User_Prefs_c, getValues ( ). Show _Help_c;
Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c;correct
Boolean show = User prefs_c, Show_Help_c;

A

Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c;

158
Q
  1. The maximum view state size of a visualforce page is______________.
    1mb
    256kb
    165kb
    65kb
    135kb
A

135kb

159
Q

An org has a custom object, Registeration_c that has a lookup relationship to the Opportunity object.

What should a developer use to create a stand-alone Vlsualforce page that displays the Registration__c records related to an Opportunity.
A standard controller with a controller extension
A controler extension
A custom controler
A standard controller

A

A standard controller

160
Q

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.setSavepoint() and Database.rollBack() with a Try/Catch statement.

B. Use a Try/Catch statement and handle DML cleanup in the catch statement.

C. Use Database methods to obtain lists of Database.SaveResults.

D. Use a Try/Catch and use sObject.addError() on any failures.

A

A. Use Database.setSavepoint() and Database.rollBack() with a Try/Catch statement.

161
Q

Which technique can run logic when an Aura Component is loaded?
A. Call $A. enqueueAction passing in the method to call.

B. Use the connectedCallback(0 method.

C. Use an aura:handler ‘init’’ event to call a function.

D. Use the standard doinit function in the controller.

A

C. Use an aura:handler ‘init’’ event to call a function.

162
Q

Which of the following object types can be used with a Web Service?
A. Lists

B. Maps

C. Matcher objects

D. Pattern objects

E. Sets

F. Exception objects

A

A. Lists

163
Q

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

A

B. lightning-record-edit-form
D. lightning-record-form

164
Q

Consider the following queries. 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. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c.
Which two queries are optimized for large data volumes? Choose 2 answers
A. SELECT Id FROM Account WHERE Id IN : aListVariable

B. SELECT Id FROM Account WHERE Name != NULL

C. SELECT Id FROM Account WHERE Name != ‘ ‘ AND Customer Number c = ‘ValueA’

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

A

A. SELECT Id FROM Account WHERE Id IN : aListVariable
C. SELECT Id FROM Account WHERE Name != ‘ ‘ AND Customer Number c = ‘ValueA’

165
Q

A company accepts orders for customers in their enterprise resource planning (ERP) crder__c records with a lookup field to Account. The Account object has an External ID field, ERP_Customer_ID__c.
What should the integration use to create new Order__c records that will automatically be related to the correct Account?
A. Upsert on the Order__c object and specify the ERP_Customer_ID__c.

B. Upsert on the Account and specify the ERP_Customer_ID__c.

C. Insert on the Order__c object followed by an update on the Order__c object.

D. Merge on the Order__c object and specify the ERP_Customer_ID__c.

A

C. Insert on the Order__c object followed by an update on the Order__c object.

166
Q

Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates? (Choose three.)
A. <apex:actionSupport>
B. <apex:commandLink>
C. <apex:actionStatus>
D. <apex:commandButton>
E. <apex:form></apex:form></apex:commandButton></apex:actionStatus></apex:commandLink></apex:actionSupport>

A

A. <apex:actionSupport>
B. <apex:commandLink>
D. <apex:commandButton></apex:commandButton></apex:commandLink></apex:actionSupport>

167
Q

What are the ways a developer can create test data of Contacts? (Choose two.)
A. Test.loadTestRecords(Contact.sObjectType, ‘staticResource’)

B. Test.createTestData ()

C. myDataFactory.createContacts(10)

D. Test.loadData(Contact.sObjectType, ‘staticResource’)

A

C. myDataFactory.createContacts(10)

D. Test.loadData(Contact.sObjectType, ‘staticResource’)

168
Q

What is the transaction limit on the number of Apex jobs added to the queue?
A. There is no limit

B. 150

C. 200

D. 50

E. 100

A

50

169
Q

A developer i$ tasked Dy Unversai Containers to build out a system to track the container repair process. Containers should be tracked as they move through the repair process, starting when a customer reports an issue and ending when the container is returned to the customer.
Which solution meets these business requirements while following best practices?
A. Build an automated Lightning Application using Application Events to ensure data integrity.

B. involve a Salesforce administrator and build out a declarative solution that works in Salesforce desktop and mobile.

C. Use Flow Builder|.to develop a Sites page for customers to submit repair requests and track the status of their request.

D. Use Platform Events with Workflow Rules and RFID integration to ensure proper tracking of the containers

A

C. Use Flow Builder|.to develop a Sites page for customers to submit repair requests and track the status of their request.

170
Q

Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called candidate as created with organization-wide default set to Private. A lookup on the Candidate object sets an employee as an the viewer user
A. The record cannot be shared with the current setup

B. The record can be shared using a sharing rule.

C. The record can be shared an Apex class.

D. The record can be shared using a permission set.

A

C. The record can be shared an Apex class.

171
Q

The REST API___________.
A. Is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, queryAII, insert, update, upsert, or delete many records asynchronously by submitting batches

B. Provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and web projects

C. Is used to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment

D. Is used to create, retrieve, update or delete records, such as accounts, leads, and custom objects, and allows you to maintain passwords, perform searches, and much more

A

B

172
Q

Which of the following exceptions cannot be caught and will force an error? (Choose three.)
A. LimitException

B. AssertException

C. SObjectExceptions

D. DMLException

E. License exceptions

F. ListException

A

A. LimitException

B. AssertException
E. License exceptions

173
Q

What Salesforce tool lets you deploy/retrieve metadata, check status of apex jobs, and check responses of REST calls?
A. Streaming API

B. Force.com Migration Tool

C. Developer Console

D. Workbench

A

D. Workbench

174
Q

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 when they save a Lead record.
Which best practice should the developer use to perform the validations, and allow more than one error message to be displayed simultaneously?
A. Process Builder

B. Client-side validation

C. Apex REST

D. Custom validation rules

A

B. Client-side validation

175
Q

Consider the following code snippet:
A developer created the following test class to provide the proper code coverage for the snippet above:
However, when the test runs, no data is returned and the assertion fails.
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 setFixedSearchResults method in the test class.

B. Enclose the method call within Test. startTest () and Test , stop Test ()

C. Implement the without sharing keyword in the searchfeature Apex class.

D. Implement the seeAllData=true attribute in the @isTest annotation.

A

A. Implement the setFixedSearchResults method in the test class.

176
Q

Which of the following about Dynamic Apex is incorrect?
A. You can retrieve the sObject type from an Id by calling .getSObjectTypeQ

B. getDescribe() can get you a variety of info on a particular object/field

C. Schema.getGlobalDescribeQ gives you a map of all sObject

D. In dynamic SOQL, you can use bind variables and bind variable fields

A

D. In dynamic SOQL, you can use bind variables and bind variable fields

177
Q

In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render?
A. Set the re-render attribute of the component to true.

B. Set the rendered attribute of the component to true and re-render a parent component.

C. Set the rendered attribute of the component to true and re-render the component.

D. Perform a full page refresh since rendered elements cannot be re-rendered without refreshing

A

B. Set the rendered attribute of the component to true and re-render a parent component.

178
Q

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 Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include m the response?
A. Use the getCustomObject ( ) method from the Schema class.

B. Check the isCustom ( ) value on the sObject describe result.

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

D. Check the getObjectType () value for Custom’ or ‘Standard’ on the sObject describe result.

A

B. Check the isCustom ( ) value on the sObject describe result.

179
Q

A developer has a page with two extensions overriding the Standard controller for Case.

What will happen when a user clicks the command button?
A. Save from CaseExtensionTwo will be executed

B. All of the three Save methods will be executed

C. Save from Case Standard Controller will be executed

D. Save from CaseExtensionOne will be executed

A

D. Save from CaseExtensionOne will be executed

180
Q

A developer wants to use an Aura Component with a Custom Action.
What should be considered in order to do this?
A. The component must implement the force:lightningQuickActionButton interface.

B. The class “slds-modal__container” must be added to the top-level element of the component.

C. The component’s JavaScript controller must handle a method on initialization.

D. A default value must be provided for each component attribute marked as required

A

A. The component must implement the force:lightningQuickActionButton interface.

181
Q

As part of a new integration, a developer is asked to implement a new custom search functionality that is capable of performing unrestricted queries and can account for all values within a custom picklist field, type__z, on the Opportunity object. The search feature must also account for NULL values.
The organization-wide default for the Opportunity object is set to Public Read-Only, and a new custom index has.
been created for the Type__c field. There are more than 5 million Opportunity records within the environment.
and a considerable amount of the existing records have NULL values for the picklist Which technique should the developer implement to maximize performance when querying NULL values?
A. Use the OS operator to combine WHERE clauses to strictly search for each value within the picklist, including Type__c ‘ NULL.

B. Create a formula field that substitutes NULL values for a string of text, create an index for the formula field, then use the formula within the WHERE clause.

C. Perform two SOQL queries; one to query Opportunities where Type__c - NULL, and another to query where Type_: - HBLL, then join the result set using Apex.

D. Use a SOSL query to return ALL opportunities that have a value of NULL in any field.

A

C. Perform two SOQL queries; one to query Opportunities where Type__c - NULL, and another to query where Type_: - HBLL, then join the result set using Apex.

182
Q

Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users.
What are two alternatives to implement the integration and protect against malicious calls to Heroku app’s endpoint? Choose 2 answers
A. Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce.

B. Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce.

C. Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key. so that the Heroku app can authenticate requests and store the resized images in Salesforce.

D. Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data; therefore the Heroku app can automatically reply back to the callout with the resized images in Salesforce.

A

A. Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce.

B. Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce.

183
Q

@isTest static void testAccountUpdate() { Account acct = new Account({Name = ‘Test’); acct.Integration Updated_c = false; insert acct; CalloutUtil.sendAccountUpdate (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 above 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() and Test.setMock before and Test.stopTest() after CalloutUtil.sendAccountUpdate.

B. Add Test.startTest() 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.

A

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

184
Q

A developer creates an application event that has triggered an infinite loop. What may have caused this problem?
A. The event has multiple handlers registered in the project.

B. The event Is fired from a custom renderer.

C. The event handler calls a trigger.

D. An event is fired ontouchend” and is unhandled.

A

B. The event Is fired from a custom renderer.

185
Q

Which three approaches should a developer Implement to obtain the best performance for data retrieval when building a Lightning web component?
Choose 3 answers
A. Use lazy load for occasionally accessed data.

B. Use the Lightning Data Service.

C. Use layoutTypes : [‘Full’] to display a set of fields.

D. Use getRecordUi to obtain metadata.

E. Use (cacheable-true) whenever possible.

A

A. Use lazy load for occasionally accessed data.

B. Use the Lightning Data Service.
E. Use (cacheable-true) whenever possible.

186
Q

A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action.
How can the developer accomplish this?
A. Use the $Controller global variable to access the controller method via JavaScript

B. Use <apex:actionFunction> to create a JavaScript wrapper for the controller method</apex:actionFunction>

C. Use <apex:actionSupport> to enable JavaScript support for the controller method</apex:actionSupport>

D. Use the @RemoteAction annotation on the method definition with JavaScript Remoting

A

D. Use the @RemoteAction annotation on the method definition with JavaScript Remoting

187
Q

A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex.
How can the developer meet these requirements? (Choose two.)
A. Use OFFSET in SOQL queries

B. Use LIMIT 50 in SOQL queries

C. Use CURSOR 50 in SOQL queries

D. Use a StandardSetController

A

A. Use OFFSET in SOQL queries

B. Use LIMIT 50 in SOQL queries

188
Q

The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers.
The test method fails at the Line 20 because of too many SOQL queries.
What is the correct way to fix this?
A. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger.

B. Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.

C. Add TesLstartTest() before and Test.stop Test() after both Line 7 of the code and Line 20 of the code.

D. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced.

A

B. Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code.

189
Q

When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data?
A. Use the ANT migration tool, the custom metadata API, or the Dataloader.

B. Deserialize the data untyped and then process it.

C. Use middleware to flatten the JSON and consume it as a new custom object.

D. Declare a class with three levels and deserialize the JSON typed with this class.

A

B. Deserialize the data untyped and then process it.

190
Q

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. Upload the third-party JavaScript library as a static resource that Imports Into the component.

B. Use a content distribution network and Include

 
 tags In the component.

C. Import the third-party JavaScript module directly Into the component.

D. Import loadscript from lightning platformResourceLoader.

A

A. Upload the third-party JavaScript library as a static resource that Imports Into the component.
D. Import loadscript from lightning platformResourceLoader.

191
Q

Universal Containers wants to be able to bring up an Account detail page and view a table of containers currently being rented. The user wants to be able to dick on a container In the table and quickly edit and save the location of the container.
In addition to this, the page should have a section that shows the location of each container on a map. Universal Containers wants the map to re-render whenever the location of a container is changed.
What can a developer use to accomplish this task?
A. Two Lightning Components leveraging Application Events

B. Two Lightning Components leveraging Platform Events

C. Two Visualforce Page Components leveraging Application Events

D. A single visualforce Page leveraging Platform Events

A

A. Two Lightning Components leveraging Application Events

192
Q

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. Call the Apex class method from a testMethod instead of the testSetup method.

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

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

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

A

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

193
Q

What is the transaction limit for the number of DML statements allowed?
A. 20

B. 2,000

C. 100 (synchronous), 200 (async)

D. 200 (synchronous), 100 (async)

E. 150

A

E. 150

194
Q

developer created three Rollup Summary fields: Total_timesheets_c, Total_Approved_timesheet_c and Total_project_Timesheet_c in the custom object, project _c Now, the developer is tasked with created a new field to show the ratio between and approved
A. A test class that validates the formula field is needed for deployment.

B. A formula field will calculate the value retroactively for existing records.

C. No test methods will be executed during deployment.

D. Using a formula field reduces maintenance overhead.

A

BD

195
Q

A Visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?
A. use lazy loading to load the data on demand, instead of in the controller’s constructor.

B. use an <apex:actionPoller> in the page to load all of the data asynchronously.</apex:actionPoller>

C. use Javascript to move data processing to the browser instead of the controller.

D. Use the transient keyword for the List variables used in the custom controller.

A

A. use lazy loading to load the data on demand, instead of in the controller’s constructor.

196
Q

developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)
A. Ensure all callouts are completed prior to executing DML statements

B. Use Database.insert (order, true) to immediately commit any database changes

C. Move the web service callout into an future method

D. Use the asyncSend() method of the HTTP class to send the request in async context

A

A. Ensure all callouts are completed prior to executing DML statements
C. Move the web service callout into an future method

197
Q

A developer is integrated with a legacy on-premises SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?
A. Formula field

B. External Object

C. Lookup field

D. External Id field

A

D. External Id field

198
Q

A corporation has many different Salesforce orgs, with some different objects and some common objects, and wants to build an 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. Metadata API

B. SOAP API with the Enterprise WSDL

C. SOAP API with the partner WSDL

D. Apex REST Web Service

A

D. Apex REST Web Service

199
Q

A company has a web page that needs to get Account record information, given its Salesforce record ID, from JavaScript on the page and then display it. Which method of integration is optimal?
A. SOAP API

B. REST API

C. Apex REST Web Service

D. Apex SOAP Web Service

A

C. Apex REST Web Service

200
Q

A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?
A. Static resources

B. Custom metadata

C. Custom settings

D. System.Cookie class

A

C. Custom settings

201
Q

Which statement is true regarding savepoints?
A. Reference to savepoints can cross trigger invocations.

B. Static variables are not reverted during a rollback.

C. Savepoints are not limited by DML statement governor limits

D. You can roll back to any savepoint variable created In any order

A

B. Static variables are not reverted during a rollback.

202
Q

A developer creates a Lightning web component to allow a Contact to be quickly entered- However, error messages are not displayed.
Which component should the developer add to the form to display error messages?
A. aura:messages

B. lightning-error

C. lightning-messages

D. apex:messages

A

C. lightning-messages

203
Q

Consider the above trigger intended to assign the Account to the manager of the Account’’s region. Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers
A. Use a Map accountMap instead of List accountList.

B. Remove the last line updating accountList as it is not needed.

C. Use a Map to cache the results of the Region__c query by Id.

D. Move the Region__c query to outside the loop.

A

BD

204
Q

In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing? (Choose three.)
A. Every record created by sales users needs to be visible to their respective manager

B. There is an existing, external system of truth for user access assignments which will continue to drive access and be integrated with salesforce

C. Team functionality is required on custom objects

D. Poor performance when using native sharing components

E. You need to change record access to read/write for all users utilising a lightning component

A

BCD

205
Q

Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce.
What should the developer use to implement this integration?
A. A workflow rule with an outbound message that contains a session ID

B. A flow that calls an @future method that allows callouts

C. A platform event that makes a callout to the web application

D. An Apex trigger that calls an @future method that allows callouts

A

C. A platform event that makes a callout to the web application

206
Q

A developer created a class that implement he 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 Test.isRunningtest ( ) to prevent chaining jobs during test execution.

B. Enclose System.enqueueJob (new orderQueueable Job ( }) within Test. starttest and Test, stoptest ()

C. Implement seeAllData-true to ensure the Queueable )ob is able to run in bulk mode.

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

A

A. Implement Test.isRunningtest ( ) to prevent chaining jobs during test execution.
C. Implement seeAllData-true to ensure the Queueable job is able to run in bulk mode.

207
Q

Choose the correct definition for <apex:actionFunction>.
A. Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and shows content conditionally depending on the status of the request (in progress/complete). Use the "id" field to specify name; use "status" field on related components to connect them</apex:actionFunction>

B. Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.)

C. Allows for controller methods to be called directly from Javascript. Must be| encapsulated in <apex:form> tags. Unlike actionSupport, these function<apex:actionPoller>s can be called directly from Javascript code B Sends an AJAX request according to the time interval you specify. If this ever gets re-rendered, it resets</apex:actionPoller></apex:form>

D. Signifies which components should be processed by the server when an AJAX request is generated

A

A. Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and shows content conditionally depending on the status of the request (in progress/complete). Use the “id” field to specify name; use “status” field on related components to connect them

208
Q

Consider the following code snippet, depicting an Azure component:

Which two interfaces can the developer implement to make the component available as a quick action?
Choose 2 answers
A. Lightning QuickActionAPI

B. Force:lightningQuicAction

C. Force hasObjectName

D. Force:hasRecordId

E. Force:lightningQuickActionWithoutHeader

A

BE

209
Q

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.

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. Change the CalloutUtil.makeRestCallout to an @future method

B. Move the CalloutUtil.makeRestCallout method call below the catch block.

C. Remove the Database.setSavepoint and Database.rollback.

D. Change the CalloutUtil.makeRestCallout to an @InvocableMethod method.

A

A. Change the CalloutUtil.makeRestCallout to an @future method

210
Q

A user receives the generic “An internal server error has occurred” while interacting with a custom Lightning Component. What should the developer do to ensure a more meaningful message?
A. Add an error-view component to the markup.

B. Use ProcessBuilder to catch the error.

C. Use an AuraHandledException in a try/catch block.

D. Add an onerror event handler to the tag.

A

C. Use an AuraHandledException in a try/catch block.

211
Q

During the Visualforce Page execution, what step follows immediately after “Evaluate constructors on controller and extensions”?
A. Evaluate constructors, extensions, and expression on attribute definitions on any custom components present

B. Create the view state

C. Evaluate expressions, <apex:page> attribute actions, and other method calls (getters/setters) on main page</apex:page>

D. Send HTML to Browser

A

A. Evaluate constructors, extensions, and expression on attribute definitions on any custom components present

212
Q

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
What is the most efficient way to Query such information?
A. [Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN
B. (‘StageName’, Probability’,Amount /CloseDate’)];

C. [Select Amount, CloseDate, StageName, Probability FROM OpportunityHistory WHERE Opportunityld = :oppId];

D. [Select Amount CloseDate. StageName, Probability FROM Opportunity_History WHERE Opportunityld - :oppId];

E. [Select Newvalue, Oldvalue From OpportunityField_History Where Oppportunity = oppid AND Field IN

A

A. [Select NewValue, Oldvalue FROM Opportunity FieldHistory WHERE Opportunityld = :oppId AND Field IN

213
Q

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. Annotate the method with the @Future annotation.

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

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

D. Use the Database.queryLocator method to retrieve the accounts.

A

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

214
Q

What is the transaction limit for the number of records per DML statement?
A. There is no limit

B. 50,000

C. 20,000

D. 5,000

E. 10,000

A

E. 10,000

215
Q

A developer receives an error when trying to call a global server-side method using the @remoteAction decorator. How can the developer resolve the error?
A. Add static to the server-side method signature.

B. Decorate the server-side method with (static=false)

C. Change the function signature to be private static.

D. Decorate the server-side method with (static=true).

A

A. Add static to the server-side method signature.

216
Q

A company decides that every time an Opportunity is created, they want to create a follow up Task and assign it to the Opportunity Owner.
What should a developer use to implement the requirements?
A. A trigger on Task

B. A trigger on Opportunity

C. A Process Builder on Opportunity

D. A Process Builder on Task

A

C. A Process Builder on Opportunity

217
Q

A Visualforce 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 setters signature to return a Contact.

B. Change the getter’s signature to be static Contact.

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

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

A

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

218
Q

The “Webservice” keyword___________.
A. Used for any member variables included

B. All of the above

C. Can be used on all classes

D. Method must be static, and class must be global

A

B. All of the above

219
Q

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 dosed. 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 has not defined an Account owner when inserting the test data.

B. The test class has not implemented seeAIIData-truwh the test method.

C. The test class is not using System.runAs() to run tests as a Salesforce administrator.

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

A

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

220
Q

A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup.
What are three actions to enable this functionality? (Choose three.)
A. Surround the data insertion with Test.startTest(), Test.stopTest()

B. Surround the callout with TeststartTest(), Test.stopTest()

C. Implement the WebServiceMock interface

D. Update code to call Test.setMock()

E. Implement the HttpCalloutMock interface

A

B. Surround the callout with TeststartTest(), Test.stopTest()

C. Implement the WebServiceMock interface

D. Update code to call Test.setMock()

221
Q

A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity’s Probability is greater than 50%. What is the optimal way to automate this?
A. Use an Apex Trigger on Opportunity.

B. Build a Process on Opportunity

C. Create a Workflow on Opportunity.

D. Build a Flow on Opportunity.

A

D

222
Q

What tool in the Developer Console contains information on SOQL query Cardinality?
A. Query Plan Tool

B. Log Inspector

C. Checkpoints tab

D. View State Tab

E. Query Editor

A

B. Log Inspector

223
Q

A developer has a Batch Apex process, Batch_Account_Sales, that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed In the sandbox. However, the developer cannot get code coverage on the Batch Apex class.
The test class is below:

What is causing the code coverage problem?
A. The account creation already sets the sates amount to 0.

B. The batch needs more than one account record created.

C. The executeBatch must fail within test. startTest ( ) and - test. stopTest().

D. The batch process will not recognize new accounts created in the same session

A

C. The executeBatch must fail within test. startTest ( ) and - test. stopTest().

224
Q

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. Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

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. Add the required field to the data setup for all of the unit tests.

A

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

225
Q

Which technique can run custom logic when a Lightning web component is loaded?
A. Use an aura:handler “init” event to call a function.

B. Use the renderedCallback ( ) method.

C. Use the connectedCallback () method.

D. Call SA.enqueueAction passing in the method to call.

A

C. Use the connectedCallback () method.

226
Q

The following code segment is railed from a Trigger handler class from the Opportunity trigger:

Which two changes should improve this code and make it more efficient? Choose 2 answers
A. Move the SOQL to fetch the account record outside of the for loop.

B. Use Triginstead.old instead of Trigger.new.

C. Move business logic inside the Opportunity trigger.

D. Move the DML outside of the for loop.

A

A. Move the SOQL to fetch the account record outside of the for loop.
D. Move the DML outside of the for loop.

227
Q

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 ail the test data that is needed to perform the tests.
What should the developer do to speed up test execution?
A. Reduce the amount of test methods in the class.

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

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

D. Ensure proper usage of test data factory In all test methods.

A

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

228
Q

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 now

B. Lightning web component

C. Apex method that returns a Continuation object

D. Process Builder

A

B. Lightning web component

C. Apex method that returns a Continuation object

229
Q

What is the transaction limit on the max timeout for all callouts?
A. 60 seconds

B. 120 seconds

C. 60 seconds (synchronous); 200 seconds (async

D. There is no limit

E. 120 seconds (synchronous); 200 seconds (async)

A

B. 120 seconds

230
Q

When a Lightning web component is rendered, a list of opportunity that match certain criteria should be retrieved from the database and displayed to the end-user.
Which three considerations must the developer implement to make the fetchOpps method available within the Lightning web component?
A. The fetchOpps method cannot mutate the result set retrieved from the database.

B. The fecthOpps method must be annotated with the @ AuraEnabled annotation.

C. The fetchOpps method must be annotated with the @InvocableMethod annotation.

D. The fetchOpps method must specify the (cacheable =true) attribute

E. The fetchOpps method must specify the (continustion-true) attribute

A

A. The fetchOpps method cannot mutate the result set retrieved from the database.

B. The fecthOpps method must be annotated with the @ AuraEnabled annotation.

D. The fetchOpps method must specify the (cacheable =true) attribute

231
Q

In an organization that has multi-currency enabled, a developer is tasked with building a Lighting Component that displays the top ten Opportunities most recently access by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user’s locale.
What is the most effective approach to ensure values displayed respect the user’s locale settings?
A. Use REGEX expressions to format the values retrieved via SOQL.

B. Use the FOR VIEW clause in the SOQL Query.

C. Use a wrapper class to format the values retrieved via SOQL.

D. Use the FORMAT() function in the SOQL query.

A

D. Use the FORMAT() function in the SOQL query.

232
Q

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 the number of Tabs and Accordion components.

C. Analyze the page with Performance Analysis for App Builder.

D. Limit 25 fields on the record detail page.

A

C. Analyze the page with Performance Analysis for App Builder.

D. Limit 25 fields on the record detail page.

233
Q

A company has a Request__c object that has a lookup to the Opportunity object and a custom field. Status__c, with values of Open,’ Closed, and Invalid.’ An Opportunity should not be allowed to be deleted if there are any Request__c records related to it that have a Status__c value of Open or ‘Closed.’ what is the optimal way to enforce the requirement to prevent deletion?
A. A Process on Opportunity

B. A Process on Request__c

C. An Apex Trigger on Request__c

D. An Apex Trigger on Opportunity

A

D. An Apex Trigger on Opportunity

234
Q

A company processes Orders within their Salesforce instance. When an Order’s status changes to ‘Paid’ it must notify the company’s order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?
A. Generate the Partner WSDL and use it to make a callout to the OMS.

B. Generate the Enterprise WSDL and use it to make a callout to the OMS.

C. Create an Apex trigger and make a callout to the OMS from the trigger.

D. Create an Outbound Message that contains the session ID and send it to the OMS

A

B. Generate the Enterprise WSDL and use it to make a callout to the OMS.

235
Q

A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components.
Which annotation should the developer add to the Apex method to achieve this?
A. @RemoteAction(cacheable=true)

B. @RemoteAction

C. @AuraEnable

D. @AuraEnabled

A

C. @AuraEnable

236
Q

A developer is building a Lightning web component that searches for Contacts and must communicate the search results to other Lightning web components when the search completes.
What should the developer do to implement the communication?
A. Publish an event on an event channel.

B. Fire an application event.

C. Publish a message on a message channel.

D. Fire a custom component event.

A

C. Publish a message on a message channel.

237
Q

This sales team needs a custom Visualforce page to enter sales orders. When a product is selected on the Visualforce page, a web service is invoked to determine if the product is in stock, and the result is displayed on the page.
How can a developer write this page to display the result of the web service and ensure governor limits for concurrent usage are not exceeded?
A. Use an Apex trigger with callout=true annotation.

B. Use visualforce Remoting to handle the web service callout.

C. Use Continuation that is invoked when a Submit button is clicked.

D. Use the Salesforce Metadata API in the web service callout.

A

C. Use Continuation that is invoked when a Submit button is clicked.

238
Q

What is the best practice to initialize a Visualforce page in a test class?
A. Use Test.currentpage, getParameter, put (MyTestPage);

B. Use Test, setCurrentPage(Page.MyTestPage);

C. Use controller,currentPage, setPage (MyTestPage

D. Use Test.setCurrentpage,MyTestPage;

A

B. Use Test, setCurrentPage(Page.MyTestPage);

239
Q

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. Move the prerequisite reference data setup to a static method in the test class and call that from each test method.

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

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

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

A

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

240
Q

A developer receives the exception ‘SOQL query not selective enough’ when performing a query on an object with a large amount of dat a. Which step should be taken to resolve the issue?
A. Move the SOQL query to within an asynchronous process.

B. Use an ID in the WHERE clause of the SOQL query.

C. Perform the SOQL query via a call to the REST API.

D. Perform the SOQL query as part of a FOR loop.

A

B. Use an ID in the WHERE clause of the SOQL query.

241
Q

A developer wants to call an Apex Server-side Controller from a Lightning Aura Component. What are two limitations to the data being returned by the Controller? Choose 2 answers
A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.

B. Basic data types are supported, but defaults, such as maximum size for a number, are defined by the objects that they map to.

C. Only Basic data types and sObjects are supported as return types for Apex Controllers called by Lightning Aura Components.

D. A Lists of Custom Apex Classes cannot be returned by Apex Controllers called by Lightning Aura Components.

A

A. A custom Apex Class can be returned, but only the values of public instance properties and methods annotated with @AuraEnabled are serialized and returned.

C

242
Q

A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available. What change should be applied to the component?
A. Look for errors in the logic in the JavaScript controller.

B. Delete the component, metadata, and Apex controller and recreate them.

C. Refresh the sandbox and upgrade it to the latest API version.

D. Expose it in the markup using the implements and access attributes.

A

D. Expose it in the markup using the implements and access attributes.

243
Q

How long is field history retained?
A. 36 Months

B. 6 Months

C. 24 Months

D. 12 Months

E. 18 Months

A

E. 18 Months

244
Q

What is the transaction limit for SOQL queries?
A. 200 (synchronous), 100 (async)

B. 20 (synchronous), 200 (async)

C. 150 (synchronous), 200 (async)

D. 100 (synchronous), 200 (async)

E. 150 (synchronous), 20 (async)

A

D. 100 (synchronous), 200 (async)