EMT Practice Test

1. Question Content...


Question List

Question1: 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?

Question2: Which use case can be performed only by using asynchronous Apex?

Question3: Refer to the code snippet below:

As part of an Integration development effort, a developer is tasked to create an Apex method mat 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?

Question4: 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?

Question5: A software company uses a custom object Defect_c, to track defects in their software, Defect__c has organisation-wide defaults set to private Each Dafect__c has a related list of Reviewer_c records, each with a lookup field to User that is used to indicate that the User will review the Defect_c.
What should be used to give the User on the Reviewer_c record read only access to the Defect_c record on the Reviewer_c record?

Question6: A business currently has a process to manually upload orders from its external Order Management System (OMS) into Salesforce.
This is a labor intensive process since accounts must be exported out of Salesforce to get the IDs. The upload file must be updated with the correct account IDs to relate the orders to the corresponding accounts.
Which two recommendations should make this process more efficient?
Choose 2 answers

Question7: 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?

Question8: Refer to the Aura component below:
Component markup:

Controller JS:

A developer receives complaints that the component loads slowly.
Which change can the developer implement to make the component perform faster?

Question9: A developer sees test failures in the sandbox but not in production. No code or metadata changes have been actively made to either environment since the sandbox was created.
Which consideration should be checked to resolve the issue?

Question10: After a Platform Event is defined in a Salesforce org, events can be published via which two mechanisms?
Choose 2 answers

Question11: 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?

Question12:
The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.
The test method fails at the Line 20 because of too many SOQL queries
What is the correct way to fix this?

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?

Question13: 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

Question14: An org records customer order information In a custom object, Orcer__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 fiat 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?

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

Question16: Which statement is true regarding savepoints?

Question17:
What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

Question18: A developer is building a Lightning web component that searches for Contacts. The component must communicate the search results to other unrelated Lightning web components, that are in different DOM trees, when the search completes.
What should the developer do to implement the communication?

Question19: A developer created a Lightning web component that uses a lightning-record-edit-form t 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.
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?

Question20: A company uses Salesforce to sell products to customers. They also have an external product information management (P1M) system that If the system of record for products.
A developer received these requirements
* Whenever a product is created or updated in the PIM, a product must be created or updated as a Product2 record in Salesforce and a PricebookEntry record must be created or updated automatically by Salesforce.
* The PricebookEntry should be created in a Pricebooki that is specified in a custom setting.
What should the developer use to satisfy these requirements?

Question21: Refer to the markup below:
A Lightning web component displays the Account name and two custom fields out of 275 that exist on the object. The developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?

Question22: Which three actions must be completed in a Lightning web component for a JavaScript file in a static resource to be loaded?
Choose 3 answer

Question23: Universal Containers implements a private sharing model for the Convention_Attendence_c custom object. As part of a new quality assurance effort, the company created an Event___Reviewer__c user lookup field on the object. Management wants the event reviewer to automatically gain Read/write access to every record they are assigned to.
What is the best approach to ensure the assigned reviewer obtains Read/Write access to the record?

Question24: An org has a Process Builder process on Opportunity that sets a custom field,CommissionBaseAmount__c, when an Opportunity is edited and the Opportunity's Amount changes.
A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__c and complex logic to calculate a value for a custom field CommissionAmount_c, when an Opportunity stage changes to Closed/Won.
Users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save, the C:rr.i;5icnA.T.cur.t c is incorrect.
Which two actions should the developer take to correct this problem? Choose 2 answers

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

Question26: A company uses Opportunism to track sales to their customers and their org has millions of Opportunities.
They want to begging 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 and populated.
What is the optimal way to automate this?

Question27: Universal containers needs to integrate with several external systems. The process is initiated when a record is created in Salesforce. The remote systems do not require Salesforce to wait for a response before continuing.
What is the recommended best solution to accomplish this?

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

Question29: 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

Question30: 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 users locale settings?

Question31: 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 CurrencylsoCode Text field that contains the currency code they should use. If a Catalog's CurrencylsoCode changes, all of its Catalog Items' CurrencylsoCodes should be changed as well.
What should a developer use to update the CurrencylsoCodes on the Catalog Items when the Catalog's CurrencylsoCode changes^5

Question32: A developer Is asked to develop a new AppExthange 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?

Question33: 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?

Question34: Refer to the component code and requirements below:
Requirements:
1. For mobile devices, the information should display In three rows.
2. For desktops and tablets, the information should display in 2 single row.
Requirement 2 is not displaying as desired.
Which option has the correct component code to meet the requirements for desktops and and tablets?

Question35: A developer implemented a custom data table in a Lightning web component with filter functionality.
However, users are submitted support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records the selected filters.
What should the developer do to improve performance of the component?

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

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

Question37: Which technique can run custom logic when a Lightning web component is loaded?

Question38: 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?

Question39: 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. What is a possible solution?

Question40: A developer has a test class that creates test data before making a mock call-out, but now receives a you have uncommitted work pending. Please commit or callout before calling out error.
What step should be taken to resolve the error?

Question41: 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?

Question42: What are three reasons that a developer should write Jest tests for Lightning web components?
Choose 3 answers

Question43:
AWC wants the real-time inventory reduction for a product to be sent to many of its external systems, including some future systems the company is Currently planning.
What should a develops add to the code at the placeholder to meet these requirement!?

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

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

Question45: Global with sharing class MyRemoter { public String accountName { get; set; } public static Account account
{ get; set; } public AccountRemoter(} {} @RemoteAction global static Account getAccount (String acccuntName) { 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?

Question46: 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 AccountWrappers and is called imperatively from a JavaScript event handler.

Which two changes should the developer make so the Apex method functions correctly?
Choose 2 answers

Question47: As part of a new integration, a developer is asked to implement a new custom search functional that is capable of performing unrestricted Queries and can account for all values within a custom picklist field. Type_ c, 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?

Question48: Consider the following code snippet:
How should <c-order> component communicate to the <c-order-order> component that an order has been selected by the user?

Question49: A developer is working on a set of custom Aura components that can be Individually added to a home page.
One of the components, c:searchAccounts, allows users to search for an Account and then select a specific found Account. Once selected, the other components.
Should get other information related to the selected Account and display it Which event should the c: 2eazchRccounta component fire to make it known that an Account is selected?

Question50: 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?

Question51:

Question52: What should a developer use to query all Account fields for the Acme account in their sandbox?

Question53: Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers' sales representatives can edit the orders on the same Visualforce page.
What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?

Question54: A Page throws an Attempt to dereference a null object error for a Contact. What change In the controller will fix the error?

Question55:
The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer.
The test method fails at the Line 20 because of too many SOQL queries
What is the correct way to fix this?

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?

Question56: 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 thatrelated the Contact to the various Account records that represent the departments.
Which solution solves these requirements?

Question57: A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.
A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.
What should the developer do to ensure the parent always has a child record?

Question58: Universal Containers uses Salesforce to manage its product offerings to customers.
A developer is building a custom mobile app that must allow app users to view product information, in real time, that is stored in Salesforce.
What should the developer use to get the product information from Salesforce?

Question59: Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Products__z, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, Including product_c field.
What should the developer do to ensure the value of Products__c is in the current user's language?

Question60: 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?

Question61: 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) 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?

Question62: 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

Question63: 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.
What should the developer use to ensure the site is multilingual?

Question64: A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:
Caura: component implements-"forcethaaRecordid, flexipage:availableForAllPageTypes">
<div>Hello!</div>
</aura:component>
How can the component's controller get the context of the Lightning page that the sobject is an without requiring additional best coverage?

Question65: Account object has a field, Audit_Code__, that is used to specify what type of auditing the Account needs and a Lookup to user, Auditor__ that is the assigned auditor.
When an Account is initially created, the user specifies the Audit_Code__. Each User in the org has a unique text field, that is used to automatically assign the correct user to the Account Auditor__ field.

What should be changed to most optimize the code's efficiency?
Choose 2 answers

Question66: 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?

Question67: A developer has created, Lightning web component that uses the get Record wire adapter.
Which three things should the developer do in a test validate the wire method is working as expected?
Choose 3 answer

Question68: A developer is building a Lightning web component that retrieves data from Salesforce and assigns it to the record property.

What must be done in the component to get the data from Salesforce?

Question69: Refer to the code snippet below:

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?

Question70:
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

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

Question72: What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Question73: 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?

Question74: A developer is asked to create a Lightning web component that will be invoked via button on a record page.
The component must be displayed in a model dialog.
Which three steps should the developer take to achieve this?
Choose 3 answers

Question75: 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?

Question76: 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?

Question77: A developer has requirement to query three fields (id, name, Type) from an Account and first and last names for all Contacts associated with the Account.
Which option is the preferred optimized method to achieve this for the Account named 'Ozene Electronics'?

Question78: Refer to the following code snippets:
MyOpportunities.js

OpportunityController.cIs

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 issue7

Question79: 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

Question80: As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles error* using toast messages. When the development is complete, all the components are added to the same Lightning page.
During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the component Which two techniques should the developer Implement to improve the user experience?
Choose 2 answers

Question81: 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.
What should the developer do to eliminate the limit exception error?

Question82: Consider the following code snippet:
How should <c-order> component communicate to the <c-order-order> component that an order has been selected by the user?

Question83: Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving m Account.
How can a developer fix this error?

Question84: The Account object has a field, auais_Code__c, that is used to specify what type of auditing the Account needs and a Lookup to User, Ruditor_c, that is the assigned auditor.
When an Account is initially created, the user specifies the Audit_Code__c. Each User in the org has a unique text field, Rudi.
that is used to automatically assign the correct user to the Account's Auditor__c field.

What should be changed to most optimize the code's effidency?
Choose 2 answers