Important file 1-1
Important file 1-1
Question: A developer created a Lightning web component that allows users to input a text value that is used to
search for Accounts by calling an Apex method. The Apex method returns a list of Accountappers and is called
imperatively from a JavaScript event handler.
return wrappers;
Which two changes should the developer make so the Apex method functions correctly?
Choose 2 answers
Question: A developer is asked to look into an issue where a scheduled Apex is running into DML limits.
Upon investigation, the developer finds that the number of records processed by the scheduled Apex has
recently increased to more than 10,000.
Question: Users report that a button on a custom Lightning web component is not working. However, there are
no other details provided.
What should the developer use to ensure error messages are properly displayed?
What should be used to automatically give Read access to the record when the lookup field is set to the
Interviewer user?
Question: A company needs to automatically delete sensitive information after seven years. This could delete
almost a million records every day.
Ans: Schedule a batch Apex process to run every day that queries and deletes records older than seven years.
Question: An environment has two Apex triggers: an after-update trigger on Account and an after-update
trigger on Contact
The Account after-update trigger fires whenever an Account's address is updated, and it updates every
associated Contact with that address The Contact after-update trigger fires on every edit, and it updates every
Campaign Member record related to the Contact with the Contact's state.
Consider the following: A mass update of 200 Account records addresses, where each Account has 50
Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across the
Accounts and 10,000 Campaign Member records across the contacts.
Ans: The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of
records processed by DML statements.
Question: Universal Containers (UC) currently does all development in its full copy sandbox Recently, UC has
projects that require multiple developers to develop concurrently. UC is running into issues with developers
making changes that cause errors in work done by other developers.
Additionally, when they are ready to deploy, many unit tests fail which prevents the deployment
Which three types of orgs should be recommended to UC to eliminate these problems? Choose 3 answers
Development org
Question: Which use case can be performed only by using asynchronous Apex?
Question: 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
Ans: Apex method that returns a Continuation object
Question: A developer is creating a Lightning web component that displays a list of records in a lightning-
datatable. After saving a new record to the database, the list is not updating.
data
@wire (recordList,{recordId:’$recordId’})
records(result) {
if(result.data){
this.data=result.data;
else if(result.error){
this.showToast(result,error);
What should the developer change in the code above for this to happen?
Question: An org records customer order information in a custom object, Order_c, that has fields for the
shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a
flat percentage rate associated with the region of the shipping address.
What should the developer use to store the rates by region, so that when the changes are deployed to
production no additional steps are needed for the calculation to work?
Question: A developer wrote a class named account Historyblanager that relies on field history tracking. The
class has a static method called getAccountHistory that takes in an Account as a parameter and returns a list of
associated account History object records.
@isTest
insert a;
a.name=a.name+’1’;
List <accountHistory> ahlist =AccountHistorytManager.getAccountHistory (a);
Question: A company has an Apex process that makes multiple extensive database operations and web service
callouts. The database processes and web services can take a long time to run and must be run sequentially,
How should the developer write this Apex code without running into governor limits and system limitations?
Ans: Use Queueable Apex to chain the jobs to run
Question: A developer writes a Lightning web component that displays a dropdown list of all custom objects in
the org from which a user will select. An Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include in the response?
Question: 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.
Question: Given the code above, which two changes need to be made in the Apex Controller for the code to
work? Choose 2 answers
Ans: Change the argument in the Apex Controller line 05 from JSONObject to string.
Remove line 06 from the Apex Controller and instead use firstName in the return on line 07.
When the code runs, it results in a System Limit Exception with the error message: Apex heap size too large.
Which three tools or techniques should the developer use to execute the code and pause it at key lines to
visually inspect values of various Apex variables? Choose 3 answers
Developer Console
Question: When the sales team views an individual customer record, they need to see recent interactions for
the customer. These interactions can be sales orders, phone calls, or Cases. The date range for recent
interactions will be different for every customer record type.
Ans :Use Lightning Flow to read the customer's record type, and then do a dynamic query for recent
interactions and display on the View page.
Question: What should a developer use to query all Account fields for the Acme account in their sandbox?
Ans: SELECT FIELDS (ALL) FROM Account WHERE Name = "Acme' LIMIT 1
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?
Ans: There will be no accounts where the name starts with "Test".
Question: 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.
Question: Instead of waiting to send emails to support personnel directly from the finish method of a batch
Apex process, Universal Containers wants to notify an external system in the event that an unhandled
exception occurs.
Question: A developer is asked to create a Lightning web component that will be invoked via a button on a
record page. The component must be displayed in a modal dialog.
Which three steps should the developer take to achieve this? Choose 3 answers
Question: A developer is tasked with creating a Lightning web component that is responsive on various
devices. Which two components should help accomplish this goal? Choose 2 answers
Ans: lightning-layout-iten
lightning-layout
Question: Which technique can run custom logic when a Lightning web component is loaded?
Which change should the developer implement in the Apex test method to ensure the test method executes
successfully?
Ans: Add System.runAS (User) to line 14 and enclose line 14 within Test.starttest() and Test.stopTest).
Question: A developer is writing a Jest test for a Lightning web component that conditionally displays child
components based on a user's checkbox selections.
What should the developer do to properly test that the correct components display and hide for each scenario?
Ans: Reset the DOM after each test with the afterEach() method.
Question: A developer created an opportunity trigger that updates the account rating when an associated
opportunity is considered high value. Current criteria for an opportunity to be considered high value is an
amount greater than or equal to $1,000,000. However, this criteria value can change over time.
There is a new requirement to also display high value opportunities in a Lightning web component.
Which two actions should the developer take to prevent the business logic that obtains the high value
opportunities from being repeated in more than one place? Choose 2 answers
Question: Which two best practices should the developer implement to optimize this code? Choose 2 answers
Ans: Query the Pricing_Structure__e records outside of the loop.
Question: A developer created a class that implements the Queueable Interface, as follows:
// implementation logic
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
Ans: Enclose System.enqueue Job (new OrderQueveableJob) within Test.starttest and Test.stopTest).
Ensure the running user of the test class has, at least, the View All permission on the Order object.
Question: 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
@IsTest
Question:
Q. When developing a Lightning web component, which setting displays lightning-layout-items in one column
on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?
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 closed. In the test class for the trigger, the assertion to
validate the Last Sold Date field fails. What might be causing the failed assertion?
Answer: The test class has not re-queried the Account record after updating the Opportunity.
Q. A company manages information about their product offerings in custom objects named Catalog and
Catalog Item. Catalog Item has a master-detail field to Catalog, and each Catalog may have as many as
100,000 Catalog Items. Both custom objects have a CurrencyIsoCode Text field that contains the currency
code they should use. If a Catalog's CurrencyIsoCode changes, all its Catalog Items' CurrencyIsoCodes should
be changed as well. What should a developer use to update the CurrencyIsoCodes on the Catalog Items when
the Catalog's CurrencyIsoCode changes?
Answer: A Database. Schedulable and Database. Batchable class that queries the Catalog Item
object and updates the Catalog Items if the Catalog CurrencyIsoCode is different
<aura:component>
<br/>
</aura:component>
Which two interfaces can the developer implement to make the component available as a quick action?
Choose 2 answers. Answer: force:lightningQuickAction force:lightning QuickAction without Header
02 Account parentAccount;
03
06
07 insert (newContact);
08 }
As part of an integration development effort, a developer is tasked to create an Apex method that solely relies
on the use of foreign Identifiers in order to relate new contact records to existing Accounts in Salesforce. The
account object contains a field marked as an external ID, the API Name of this field is Legacy_Id__c.
What is the most efficient way to instantiate the parentAccount variable on line 02 to ensure the newly created
contact is properly related to the Account ?
Answer: Account parentAccount = [SELECT ID FROM Account WHERE Legacy_Id_c =
externalIdentifier];
Q. Which three Visualforce components can be used to initiate Ajax behavior to perform partial page
updates? Choose 3 answers
Answer:
<apex: commandButton>
<apex:commandLink>
<apex:actionSupport>
Q. Which statement is considered a best practice for writing bulk safe Apex triggers?
Answer: Add records to collections and perform DML operations against these collections.
MyRemoter() { }
account Name)
account = (SELECT ID, Name, Number Employees EROM Account WHERE Name = : account
Name); return account.
Consider the Apex class above that defines a Remote Action used on a Visualforce search page.
Which code snippet will assert that the remote action returned the correct Account?
Q. When calling a RESTful web service, the developer must implement two-way SSL authentication to
enhance security. The Salesforce admin has generated a self-sign certificate within Salesforce with a unique
name of "ERPSecCertificate". Consider the following code snippet:
Which method must the developer implement in order to sign the HTTP request with the certificate? Answer:
reg.setClientCertificateName('ERPSecCertificate');
Q. A developer created a JavaScript library that simplifies the development of repetitive tasks and features and
uploaded the library as a static resource called jsutils in Salesforce. Another developer is coding a new
Lightning web component (LWC) and wants to leverage the library.
Which statement properly loads the static resource within the LWC?
Q. A company has reference data stored in multiple custom metadata records that represent default
information and delete behaviour for certain geographic regions.
When a contact is inserted, the default information should be set on the contact from the custom metadata
records based on the contact's address information. Additionally, if a user attempts to delete a contact that
belongs to a flagged region, the user must get an error message.
Q. A developer is tasked with creating an application-centric feature on which end-users can access and update
information. This feature must be available in Lightning Experience while working seamlessly in multiple
device form factors, such as desktops, phones, and tablets. Additionally, the feature must support Addressable
URL Tabs and interact with the Salesforce Console APIs. What are two approaches a developer can take to
build the application and support the business requirements?
Choose 2 answers
Answer: Create the application using Lightning Web Components wrapped in Aura Components.
List <Account> accounts = (SELECT Id, Name FROM Account WHERE ERP_Number_c LIKE :erplumber]
Q. A developer has a test class that creates test data before making a mock callout but now receives a 'You
have uncommitted work pending.
Q. There is an Apex controller and a Visualforce page in an org that displays records with a custom filter
consisting of a combination of picklist values selected by the user.
The page takes too long to display results for some of the input combinations, while for other input choices it
throws the exception, "Maximum view state size limit exceeded".
Q. A company uses Opportunities to track sales to their customers and their org has millions of Opportunities.
They want to begin to track revenue over time through a related Revenue object.
As part of their initial implementation, they want to perform a one-time seeding of their data by automatically
creating and populating Revenue records for Opportunities, based on complex logic.
They estimate that roughly 100,000 Opportunities will have Revenue records created and populated. What is
the optimal way to automate this?
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 all the test data that is needed to perform the tests.
Q. Ursa Major Solar has a custom object, Service Job_e, with an optional Lookup field to Account called
Partner_Service_Provider_c. The Totaljobs_c field on Account tracks the total number of ServiceJob_c records
to which a partner service provider Account is related.
What should be done to ensure that the totaljobs_c field is kept up to date?
Q. An Apex trigger and Apex class increment a counter, Edit_Count_c, any time the Case is changed.
cases) {
c. Edit_Count_c = c.Edit_count_c + 1;
A new process on the Case object was just created in production for when a Case is created or updated. Since
the process was added, there are reports that Edit_Count_c is being incremented more than once for Case edits.
c: cases) {
c. Edit_count_c = c. Edit_Count__ + 1;
}
trigger on Case (before update) { if
(CageTriggerHandler.firstRun) {
CaseTrigger Handler.handle(Trigger.new);
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.
Q. A developer is debugging an Apex-based order creation process that has a requirement to have three
savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process.
During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once
the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when
the roll back to SP3 is called, a runtime error occurs.
public static void updateCreditMemo (String customer Id, Decimal new Amount) { List<Credit_Memo__c>
for (Credit_Memo__c creditMemo: [Select Id, Name, Amount_c FROM Credit Memec WHERE Customer Id
LIMIT 50]) {
A custom object called Credit_Memo__c exists 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 w Apex transaction.
In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent
race conditions within a transaction?
Answer: [Select Id, Name, Amount_c FROM Credit_Memo__c WHERE customer_id_c =: customerId
LIMIT 50 FOR UPDATE]
Q. Which two scenarios require an Apex method to be called imperatively from a Lightning web component?
Choose 2 answers
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 Apex code feature is required to
facilitate this solution?
Q. A company wants to build a custom Aura component that displays a specified Account Field Set and that
can only be added to the Account record page.
<sfdc:objects>
<sfdc:object>Account</sfdc:object>
</sfdc:objects>
</design:component>
Q. A company recently deployed a Visualforce page with a custom controller that has a data grid of
information about Opportunities in the org. Users report that they receive a "Maximum view state size limit"
error message under certain conditions.
According to Visualforce best practice, which three actions should the developer take to reduce the view state?
Choose 3 answers
Answer: Refine any SOQL queries to return only data relevant to the page.
Use the transient keyword in the Apex controller for variables that do not maintain state.
Q. An Apex class does not achieve expected code coverage. The test Setup method explicitly calls a method in
the Apex class. How can the developer generate the code coverage?
Answer: Call the Apex class method from a testMethod instead of the testSetup method.
Q. A business process requires sending new Account records to an external system. The Account Name, Id,
CreatedDate, and CreatedById must be passed to the external system in near real-time when an Account is
inserted without error. How should a developer achieve this?
Q. A developer has a Visualforce page that automatically assigns ownership of an Account to a queue upon
save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?
Answer: The test class does not retrieve the updated value from the database.
Q. A company has an Apex process that makes multiple extensive database operations and web service
callouts. The database processes and web services can take a long time to run and must be run sequentially
How should the developer write this Apex code without running into governor limits and system limitations?
Q. An org has a requirement that addresses on Contacts and Accounts should be normalized to a company
standard by Apex code any time that they are saved. What is the optimal way to implement this?
Answer: Apex triggers on Contact and Account that call a helper class to normalize the address.
Q. The Salesforce admin at Cloud Kicks created a custom object called Region_c to store all postal zip codes
in the United States and the Cloud Kicks sales region the zip code belongs to.
Object Name:
Region_c
Fields:
Zip_Code__c (Text)
Region_Name_c (Text)
Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.
Which code segment is the most efficient way to fulfill this request?
Answer:
Set <String> zips = new Set<String>;
Code);
}
List <Region__c> regions = [SELECT Zip_code_c, Region_Name_c FROM Region_c WHERE
Zip_code__C IN :zips];
Map<string,String> zipMap = new Map< string,String >(); for
Region_Name__c);
@wire(fetchopps)
Opportunities;
When a Lightning web component is rendered, a list of opportunities 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 fetchopportunities method available
within the Lightning web component?
Choose 3 answers
Answer:
The method cannot mutate the result set retrieved from the database.
Which option is the preferred, optimized method to achieve this for the Account named 'Ozone Electronics'?
Answer: Account a = [SELECT ID, Name, Type, (SELECT FirstName, LastName FROM Contacts)
FROM Account WHERE name='Ozone Electronics' LIMIT 1];
Q. Consider the following queries. For these queries, assume that there are more than 200,000 Account
records. These records include softdeleted 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.
Choose 2 answers
Answer: SELECT Id FROM Account WHERE Name != '' AND Customer_Number_c = 'ValueA’ SELECT
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.
Answer: Create a TestDataFactory class that serves as the single place to create Accounts for unit
tests and set the required field there.
Q. A developer needs to store variables to control the style and behavior of a Lightning Web Component.
Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?
Answer:
Custom Metadata
Q. A company uses their own custom-built enterprise resource planning (ERP) system to handle order
management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask
about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it
has shipped.
Which two methods can make this ERP order data visible in Salesforce?
Choose 2 answers
Answer: Have the ERP system push the data into Salesforce using the SOAP API.
Use Salesforce Connect to view real-time Order data in the ERP system.
Question: A developer is asked to develop a new AppExchange application. A feature of the program creates
Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be
configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-
box AppExchange app needs to come with a set of best practice settings that apply to most customers.
What should the developer use to store and package the custom configuration settings for the app? Answer:
Custom Metadata
Question:
Question
Region_c theRegion = [
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 2 answers
Answer:
Remove the last line updating accountList as it is not needed.
Question:
'%'+searchTerm.escapeSingleQuote() +'%'
return [
SELECT Name, Company, Annual Revenue FROM Lead WHERE Annual Revenue >= :aRevenue
AND Company LIKE :safeterm;
LIMIT 20
];
A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces
information about Leads by wire calling getFetchteadList when certain criteria are met.
Which three changes should the developer implement in the Apex class above to ensure the LWC can display
data efficiently while preserving security?
Choose 3 answers
Question:
Component markup:
<aura:component>
</aura:component>
Component controller:
{{
});
$A.enqueuection (action);
A developer is building this Aura component to display information about top Opportunities in the org.
Which three code changes must be made for the component to work?
Choose 3 answers
Question: Just prior to a new deployment the Salesforce administrator, who configured a new order fulfilment
process feature in a developer sandbox,suddenly left the company.
As part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them;
making the Order fulfilment feature ready for its go-live in the production environment.
Unfortunately, although a Change Set was started, it was not completed by the former administrator. A
developer is brought in to finish the deployment.
What should the developer do to identify the configuration changes that need to be moved into production?
Answer: Leverage the Setup Audit Trail to review the changes made by the departed Administrator and
identify which changes should be added to the Change Set.
Question
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?
Question: 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.
Question: After a Platform Event is defined in a Salesforce org, events can be published via which two
mechanisms?
Choose 2 answers
A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the
record property.
recordId; record;
What must be done in the component to get the data from Salesforce?
Answer:
Question: An org has a requirement that the Shipping Address on the Account must be validated by a third-
party web service before the Account is
allowed to be inserted. This validation must happen in real-time before the account is inserted into the system.
Additionally, the developer wants to prevent the consumption of unnecessary SME statements.
Answer: Make a callout to the web service from a custom Visualforce controller.
Question: A company has a web page that needs to get Account record information, such as name, website,
and employee number. The Salesforce record ID is known to the web page and it uses JavaScript to retrieve
the account information.
Question: What is the optimal technique a developer should use to programmatically retrieve Global Picklist
options in a test method?
Which code segment handles this request and follows best practices?
Answer:
Id recType_New =
Id recType_Renewal =
Schema. SobjectType. Opportunity.getRecordType Infos By
Developerttame().get('Renewal').getRecordTyp
Or
recTypeMap.get('New') {
Question: A developer is trying to access org data from within a test class.
Which sObject type requires the test class to have the (see AllData=true) annotation?
Answer: Report
Question: 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 accessed by the logged in user. The developer
must ensure the amount and Last ModifiedDate 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?
Question: Universal Containers implements a private sharing model for the Convention_Attendee_e custom
object. As part of a new quality assurance
effort, the company created an Event_Reviewer__c user lookup field on the object. Management wants the
event reviewer to automatically gain Read/Write access to every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?
Answer: Create an After Insert trigger on the Convention Attendee custom object, and use Apex
Sharing Reasons and Apex Managed Sharing
Question:
({
saveAndRedirect (component);
})
A company has the Lightning Component above that allows users to click a button to save their changes and
redirects them to a different page. Currently, when the user hits the Save button the records are getting saved,
but they are not redirected.
Which three techniques can a developer use to debug the JavaScript? Choose 3 answers
Answer: Enable Debug Mode for Lightning components for the user.
Question:
<Template>
<lightning-record-form
record-id={recordId} object-api-
name="Account" layout-type="Full">
</lightning-record-form>
</template>
A Lightning web component displays the Account name and two custom fields out of 275 that exist on the
object. The custom fields are correctly declared and populated. However, the developer receives complaints
that the component performs slowly.
Question: A managed package uses a list of country ISO codes and country names as reference data in many
different places from within the managed package Apex code.
Answer: Store the information in custom metadata and access it with the getall() method.
Question: Which interface needs to be implemented by an Aura component so that it may be displayed in
modal dialog by clicking a button on a Lightning record page?
Question:
@isTest
Datafactory.setupDataForMyTriggerTest();
//Utility to asser all accounts are not customers before the update
AssertUtil.assertNotCustomers(acctBefore);
For(Account a : Datafactory.accounts)
a.Is_Customer__c=true;
Update Datafactory.accounts;
AssertUtil.assertNumberOfTransfers(acctsAfter);
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.
Answer: Add Test.startTest() before line 18 of the code and add Test.stopTest() after line 18 of the
code.
Question: A developer created a Lightning web component that uses a lightning-record-edit-form to collect
information about Leads. Users complain that they only see one error message at a time about their input when
trying to save a Lead record.
What is the recommended approach to perform validations on more than one field, and display
multiple error messages simultaneously with minimal JavaScript intervention? Answer: External
JavaScript library
Question: company uses their own custom-built enterprise resource planning (ERP) system to handle order
management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask
about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it
has shipped.
Which two methods can make this ERP order data visible in Salesforce? Choose 2 answers
Answer: Use Salesforce Connect to view real-time Order data in the ERP system
Have the ERP system push the data into Salesforce using the SOAP API.
Question: Which three approaches should a developer implement to obtain the best performance for data
retrieval when building a Lightning web component? Choose 3 answers
Question: Which tag should a developer use to display different text while an <apex:commandButton>
processing an action?
Answer: <apex:actionstatus>
Question: 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.
@AuraEnabled
Some_Object_c someobj =[ SELECT ID, Name FROM Some_object_c WHERE Type__C =: theType LIMIT
1 ];
The developer verified that the queries return a single record each and there is error handling in the Aura
component, but the component is not getting anything back when calling the controller get some Data. What is
wrong?
Answer: The member's Name and option of the class MyDataWrapper should be annotated with
@AuraEnabled also.
Question: Which scenario requires a developer to use an Apex callout instead of Outbound Messaging?
Question: A developer wants to write a generic Apex method that will compare the Salesforce Name field
between any two object records. For example, to compare the Name field of an Account and an opportunity; or
the Name of an Account and a Contact
Assuming the Name field exists, how should the developer do this?
Answer: Cast each object into an sObject and use sobject.get('Name') to compare the Name fields.
Question: Which use case can be performed only by using asynchronous Apex? Answer: Calling
Question: A company has a custom object, Order_c, that has a custom picklist field, Status_c, with values of
'New,' 'In Progress,' or 'Fulfilled' and a lookup field, Contact_c, to Contact.
Which SOQL query will return a unique list of all the contact records that have no 'Fulfilled' Orders?
Answer: SELECT Id FROM Contact WHERE ID NOT IN (SELECT Contact__c FROM Order__c
WHERE
status_c =’Fulfilled’)
Question: A developer wants to integrate invoice and invoice line data into Salesforce from a custom billing
system. The developer decides to make real-time callouts from the billing system using the SOAP API.
Unfortunately, the developer is getting a lot of errors when inserting the invoice line data because the invoice
header record does not exist yet.
Question: 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 using the external ID field?
Question: What are three reasons that a developer should write Jest tests for Lightning web components?
Choose 3 answers
Question: A developer created and tested a Visualforce page in their developer sandbox, but now receives
reports that user encounter view state errors when using it in production.
Question: What are three benefits of using static resources in Visualforce and Aura components? Choose 3
answers
Answer:
Static resource files can be referenced by using the @Resource global variable instead of hardcoded
IDs.
Static resource files can be packaged into a collection of related files in a zip or jar archive.
Relative paths can be used in files in static resource archives to refer to other content
within the archive.
Question: Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving an
Account.
Answer: Use a helper class to set a Boolean to TRUE the first time a trigger is fired, and then modify
the trigger to only fire when the Boolean is FALSE.
Question: A company has a custom component that allows users to search for records of a certain object type
by invoking an Apex Controller that returns a list of results based on the user's input. When the search is
completed, a search Complete event is fired, with the results put in a results attribute of the event. The
component is designed to be used within other components and may appear on a single page more than once.
What is the optimal code that should be added to fire the event when the search has completed? Answer:
Question: A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data
correctly in a sandbox environment.
A Salesforce admin with a custom profile attempt to deploy this trigger via a change set into the production
environment, but the test class fails with an insufficient privileges error.
Answer: Add system.runast() to the test class to execute the trigger as a user with the correct object
permissions.
Question: Given a list of Opportunity records named opportunity List, which code snippet is best for querying
all Contacts of the Opportunity's Account?
Answer:
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):
Question: A developer wishes to improve runtime performance of Apex calls by caching results on the client.
<c-my-child-component></ c-my-child-component>
</template>
What is the correct way to communicate the new value of a property named "passthrough to myparent-
component if the property is defined within my-child-component? Answer: let cEvent = new
customEvent('passthrough', { detail: this.passthrough }); this.dispatchEvent (cEvent);
testUpdateSuccess() {
extension.inputValue = 'test;
System.assertNotEquals(null, pageRef);
What should be added to the setup, in the location indicated, for the unit test above to create the controller
extension for the test?
Answer:
Question: 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?
Question:
Universal Containers (UC) wants to develop a customer community to help their customers log issues with
their containers. The community needs to function for their German- and Spanish-speaking customers also. UC
heard that it's easy to create an international community using Salesforce, and hired a developer to build out
the site.
Answer: Use Custom Labels to ensure custom messages are translated properly.
Question: A company wants to implement a new call center process for handling customer service calls. The
new business process requires Service Representatives to ask the calling customer for their account number
before proceeding with the rest of the call script.
Question: How should a developer assert that a trigger with an asynchronous process has successfully run?
Answer: Create all test data in the test class, invoke Test.startTest) and Test.stopTest() and then
perform assertions.
Question: 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 the Heroku app's
endpoint?
Choose 2 answers
Answer: 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.
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.
Question: 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.
Answer: Use the standard Account List controller and implement pagination
Question: A developer is building a Lightning web component to get data from an Apex method called getData
that takes a parameter, name. The data should be retrieved when the user clicks the Load Data button.
loadData() {}
Question: A developer wants to call an Apex server-side controller from an Aura component.
What are two limitations to the data being returned by the controller? Choose 2 answers
Answer: Basic data types are supported, but defaults, such as maximum size for a number, are
defined by the objects that they map to.
A custom Apex class can be returned, but only the values of public instance properties and method
annotated with Aura Enabled are serialized and returned.
Question: Universal Containers uses Big Objects to store almost a billion customer transactions called
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.
Question: The Account edit button must be overridden in an org where a subset of users still use Salesforce
Classic. The org already has a Lightning Component that will do the work necessary for the override, and the
client wants to be able to reuse it.
Question: A developer is creating a Lightning web component that can be added to a Lightning App Page and
displayed when the page is rendered in desktop and mobile phone format. To ensure a great mobile experience,
the developer chooses to use the SLDS grid utility.
Which two Lighting web components should the developer implement to ensure the application is mobile-
ready?
Choose 2 answers
Answer: <lightning-layout></lightning-layout>
<lightning-layout-item></lightning-layout-item>
Question: 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?
Answer: An after update trigger that creates the Engineering Review record and inserts it
Question: 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:
How should the developer access the data that must be displayed?
Answer: Execute a SOQL query for Amount, Probability, Stage, and close Date on the Opportunity
History object
Question: 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. JavaScript:
@api quantity;
@api unitPrice;
Template Markup:
<template>
<div>
</template>
What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce
page?
Answer: Use System.runAs() to test as a sales rep and a community user.
Question: 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
Answer: A sandbox should be created to use as a unified testing environment instead of deploying
Change Sets directly to production
The administrators are deploying their own Change Sets over each other, thus replacing entire Page
Layouts and Workflows in Production.
Question: 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.
Question: A developer is trying to decide between creating a Visualforce component or a Lightning component
for a custom screen.
Answer: Does the screen need to be rendered as a PDF without using a third-party application
Question: Assuming the CreateOneAccount class creates one account and implements the Queueable interface,
which syntax properly tests the Apex code?
Answer:
List<Account> accts;
Test.startTest();
Account];
System.assertEquals( 1, accts.size() );
Question: 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?
Answer: Use Database. set Savepoint() and Database.rollBack () with a try-catch statement.
Question: For compliance purposes, a company is required to track long-term product usage in their org. The
information that they need to log will be collected from more than one object and, over time, they predict they
will have hundreds of millions of records.
Question: A company has a native ios order placement app that needs to connect to Salesforce to retrieve
consolidated information from many different objects in a JSON format.
Question: 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, that will vary
according to their selections when running the page.
Question: Universal Containers has an Apex trigger on Account that creates an Account Plan record when an
Account is marked as a customer. Recently a workflow rule was added so that whenever an Account is marked
as a customer, a 'Customer Since' date field is updated with today's date.
Since the addition of the workflow rule, two Account Plan records are created whenever the Account is marked
as a customer
Answer: The Apex trigger does not use a static variable to ensure it only fires once.
Question: 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 analyse and diagnose the problem in the Lightning Page?
Question: Which method should be used to convert a Date to a string in the current user's locale? Answer:
Date.format
Question: A company accepts orders for customers in their enterprise resource planning (ERP) system that
must be integrated into Salesforce as Order__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?
Answer: Upsert on the Order_c object and specify the ERP_Customer_ID__c for the Account
relationship.
Question: 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?
Question: Which two queries are selective SOQL queries and can be used for a large data set of 200,000
Account records?
Choose 2 answers
testIncrement() {
insert acet;
AuditUtil.incrementViewed (acet.Id);
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.
Question: A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk.
Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the
front desk.
Question: A developer is developing a reusable Aura component that will reside on an sObject Lightning page
with the following HTML snippet:
</aura:component>
How can the component's controller get the context of the Lightning page that the sobject is on without
requiring additional test coverage?
Question: 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>
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.
Component markup:
<aura:component>
<aura:if isTrue=”{!v.showContactInfo}”>
<c:contactInfo value=”{!v.contactInfo}”/>
</aura:if>
</aura:component>
Controller JS:
({
show);
},
// other code...
})
Which change can the developer implement to make the component perform faster?
Question: Which code statement includes an Apex method named updateAccounts in the class
AccountController for use in a Lightning web component?
Choose 2 answers
Answer: An External ID field can be used to reference a unique ID from another, external system
Question: The use of the transient keyword in Visualforce Page Controllers helps with which common
performance issue?
Question: A Lightning web component exists in the system and displays information about the record in
context as a modal. Salesforce administrators need to use this component within the Lightning App Builder.
Which two settings should the developer configure within the xml resource file?
Choose 2 answers
Question: A developer has working business logic code, but sees the following error in the test class: You have
uncommitted work pending. Please commit or rollback before calling out.
Answer: Use test. IsRunningTest () before making the callout to bypass it in test execution.
Question: The Contact object in an org is configured with workflow rules that trigger field updates. The fields
are not updating, even though the end user expects them to. The developer creates a debug log to troubleshoot
the problem.
What should the developer specify in the debug log to see the values of the workflow rule conditions and
debug the problem?
Answer: A Continuation for both the billing callout and the tax callout
Question: How should a developer verify that a specific Account record is being tested in a test class for a
Visualforce controller?
Answer: Insert the Account in the test class, instantiate the page reference in the test class, then use
System.current Page Reference().getParameters() .put() to set the Account ID.
Question: Which three actions must be completed in a Lightning web component for a JavaScript file in a
static resource to be loaded?
Choose 3 answers
Call loadscript
Question: 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 are 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?
Answer: Use a hierarchy custom setting to skip executing the logic inside the trigger for the user who
loads the data
Question: 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.
Question: A company notices that their unit tests in a test class with many methods to create many records for
prerequisite reference data are slow.
Answer: Move the prerequisite reference data setup to a TestDataFactory and call that from each test method.
Question: Consider the Apex controller below, that is called from an Aura component.
Line 1 public class Attribute Types
Line 2 {
Line 4
Line 9 }
Line 10 }
Question: 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.
Question: Universal Containers wants to use a Customer Community with Customer Community Plus licenses
to allow their customers access to track how many containers they have rented and when they are due back.
Universal Containers uses a Private sharing model for External users.
Many of their customers are multi-national corporations with complex Account hierarchies. Each account on
the hierarchy represents a department within the same business.
One of the requirements is to allow certain community users within the same Account hierarchy to see several
departments' containers, based on a custom junction object that relates the Contact to the various Account
records that represent the departments.
Question: As part of their quoting and ordering process, a company needs to send PDFs to their document
storage system's REST endpoint that supports OAuth 2.0. Each Salesforce user must be individually
authenticated with the document storage system to send the PDF.
What is the optimal way for a developer to implement the authentication to the REST endpoint? Answer:
Question: A developer is tasked with ensuring that email addresses entered into the system for Contacts and for
a Custom Object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked
domains will be stored in a custom object for ease of maintenance by users. Note that the Survey_Response__c
object is populated via a custom Visualforce page.
Question: 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.
Question: A Visualforce page loads slowly due to the large amount of data it displays.
Answer: Use lazy loading to load the data on demand, instead of in the controller's constructor.
Question: 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? Answer:
Visualforce
Question: 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? Answer: The
Question: 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.
reglines.values();
(Exception e) {
Database.rollback(sp);
System.debug(e);
The CalloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or
rollback before calling out' error.
Question: What is the best practice to initialize a Visualforce page in a test class?
Question: A page throws an 'Attempt to dereference a null object' error for a Contact
testAccountUpdate() {
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."
Question: A corporation has many different Salesforce orgs, with some different objects and some common
objects, and wants to build a single Java application that can create, retrieve, and update common object
records in all of the different orgs.
@api userid;
OpportunityController {
oppOwner){ return [
SELECT id, Name, Amount FROM Opportunity WHERE OwnerId = : oppOwner WITH
SECURITY_ENFORCED LIMIT 10];
A developer is experiencing issues with a Lightning web component. The component must surface information
about Opportunities owned by the currently logged-in user.
When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue? Answer: Use
Question: An Aura component has a section that displays some information about an Account and it works
well on the desktop, but users have to scroll horizontally to see the description field output on their mobile
devices and tablets.
<lightning:layout multiplerows=”false”>
<lightning:layoutItem size=”6”>{!v.rec.Name}
</lightning:layoutItem>
<lightning:layoutItem size=”6”>{!v.rec.Description__c}
</lightning:layoutItem>
</lightning:layout>
How should a developer change the component to be responsive for mobile and tablet devices?
</lightning:layoutItem>
</lightning:layoutItem>
</lightning:layout>
Answer: Allows for classes to be generated from WSDL and imported into Salesforce
‘@apex/OrderController.getAvailableOrders;
orders;
errors;
@wire (getOrders)
if (data)
this.orders=data;
this.error=undefined }
else if (error)
this.error =error;
this.orders= undefined
Which two changes should the developer implement in the code to ensure the component deploys
successfully? Choose 2 answers