EMT Practice Test

1. Question Content...


Question List

Question1: Universal Containers decided to transition from Classic to Lightning Experience. They asked a developer to replace a JavaScript button that was being used to create records with prepopulated values.
What can the developer use to accomplish this?

Question2: A software company uses the following objects and relationships:
* Case: to handle customer support issues
* Defect__c: a custom object to represent known issues with the company's software
* Case Defect__c a junction object between Case and Defect __c to represent that a defect is a cause of a customer issue Case and Defect__c have Private organization-wide defaults.
What should be done to share a specific Case_Defect__c record with a user?

Question3: What should a developer do to check the code coverage of a class after running all tests?

Question4: A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of Apex tests allowing them to test isolated requirements for various types of Salesforce cases.
Which approach can efficiently generate the required data for each unit test?

Question5: A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations.
Which type of Salesforce orgs should they use for their development?

Question6: A developer needs to allow users to complete a form on an Account record that will create a record for a custom object.
The form needs to display different fields depending on the user's job role, The functionality should only be available to a small group of users.
Which three things should the developer do to satisfy these requirements?
Choose 3 answers

Question7: A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers

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

Question9: Which annotation exposes an Apex class as a RESTful web service?

Question10: Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over
10,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

Question11: A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.
Which two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?
Choose 2 answers

Question12: A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org.
Which tool should the developer use to troubleshoot query performance?

Question13: Which action causes a before trigger to fire by default for Accounts?

Question14: Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a master-detail relationship with the standard Account object.
Based on some internal discussions, the UC administrator tried to change the master-detail relationship to a lookup relationship, but was not able to do so.
What is a possible reason that this change was not permitted?

Question15: A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable.
Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?

Question16: A team of many developers work in their own individual orgs that have the same configuration as the production org.
Which type of org is best suited for this scenario?

Question17: A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what is defined for payments in the Payment Processor interface.
Which implementation is correct to use the PaymentProcessor interface class?
A)
B)
C)
D)

Question18: A custom picklist field, Pool Preference_c, exists on a custom object.
The picklist contains the following options: 'Vegan', 'Kosher', 'No Preference'.
The developer must ensure a value is populated every time a record is created or updated.
What is the optimal way to ensure a value is selected every time a record is saved?

Question19: A developer has the following requirements:
* Calculate the total amount on an Order.
* Calculate the line amount for each Line Item based on quantity selected and price.
* Move Line Items to a different Order if a Line Item is not in stock.
Which relationship implementation supports these requirements on its own?

Question20: How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?

Question21: If Apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which two statements are true regarding governor limits?
Choose 2 answers

Question22: A developer must perform a complex SOQL query that joins two objects in a Lightning component.
How can the Lightning component execute the query?

Question23: A software company is using Salesforce to track the companies they sell their software to in the Account object. They also use Salesforce to track bugs in their software with a custom object, Bug__c.
As part of a process improvement initiative, they want to be able to report on which companies have reported which bugs. Each company should be able to report multiple bugs and bugs can also be reported by multiple companies.
What is needed to allow this reporting?

Question24: Refer to the following Apex code:
What is the value of x when it is written to the debug log?

Question25: A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers

Question26: A company's engineering department is conducting a month-long test on the scalability of an in-house- developed software that requires a cluster of 100 or more servers. Which of the following models is the best to use?

Question27: Where are two locations a developer can look to find information about the status of batch or future methods?
Choose 2 answers

Question28: While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accessible to the currently logged in user are displayed?

Question29: The Account object in an organization has a master-detail relationship to a child object called Branch. The following automations exist:
* Roll-up summary fields
* Custom validation rules
* Duplicate rules
developer created a trigger on the Account object.
Which two things should the developer consider while testing the trigger code?
Choose 2 answers

Question30: Flow Builder uses an Apex action to provide additional information about multiple Contacts, stored in a custom class ContactInfo.
Which is the correct definition of the Apex method that gets the additional information?

Question31: What is an example of a polymorphic lookup field in Salesforce?

Question32: Which three code lines are required to create a Lightning component on a Visualforce page?
Choose 2 answers

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

Question34: A developer wants to send an outbound message when a record meets a specific criteria.
Which two features satisfy this use case?

Question35: Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

Question36: Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.
What are two characteristics of declarative development over programmatic customization?
Choose 2 answers

Question37: A developer has an integer variable called maxAttempts. The developer needs to ensure that once maxAttempts is initialized, it preserves its value for the length of the Apex transaction; while being able to share the variable's state between trigger executions.
How should the developer declare maxAttempts to meet these requirements?

Question38: The orderHelper class is a utility class that contains business logic for processing orders. Consider the following code snippet:
A developer needs to create a constant named delivery_multiplier with a value of 4.15. The value of the constant should not change at any time in the code.
How should the developer declare the delivery multiplier constant to meet the business objectives?

Question39: Universal Containers is developing a new Lightning web component for their marketing department. They want to ensure that the component is fine-tuned and provides a seamless user experience.
What are some benefits of using the Lightning Component framework?

Question40: What should a developer use to fix a Lightning web component bug in a sandbox?

Question41: Assuming that name is a String obtained by an tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection? Choose 2 answers A) B)

C)
D)

Question42: (Full question statement)
Universal Containers recently transitioned fromClassic to Lightning Experience. One of its business processes requirescertain values from the Opportunity objectto be sent via anHTTPREST calloutto itsexternal order management systemwhen the user presses a custom button on the Opportunity detail page.
Example fields:
Name
Amount
Account
Which two methods should the developer implement to fulfill the business requirement?
Choose 2 answers.

Question43: What can be easily developed using the Lightning Component framework?

Question44: A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank.
Which automation allows the developer to satisfy this requirement in the most efficient manner?

Question45: What is the result of the following code snippet?
public word doWork(Account acct) {
for (Integer i = 0; i <= 2007 i++) {
insert acct;
}

Question46: Consider the following code snippet:
Given the multi-tenant architecture of the Salesforce platform, what is a best practice a developer should implement and ensure successful execution of the method?

Question47: A developer creates a custom exception as shown below:
public class ParityException extends Exception { }
What are two ways the developer can fire the exception in Apex?

Question48: What are three characteristics of change set deployments?
Choose 3 answers Sending a change set between two orgs requires a deployment connection.

Question49: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers

Question50: (Full question statement)
A developer is tasked with building a custom Lightning Web Component (LWC) to collectContactinformation. The form will be shared among different types of users in the org. There are security requirements stating that only certain fields should beeditable and visibleto certain groups of users.
What should the developer use in their Lightning Web Component to support the security requirements?

Question51: What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers?

Question52: A credit card company needs to implement the functionality for a service agent to process damaged or stolen credit cards. When the customers call in, the service agent must gather many pieces of information. A developer is tasked to implement this functionality.
What should the developer use to satisfy this requirement in the most efficient manner?

Question53: Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own.
What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?

Question54: (Full question statement)
Which code displays the contents of a Visualforce page as a PDF?

Question55: A developer is creating a Lightning web component to show a list of sales records.
The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field.
How should this be enforced so that the component works for both users without showing any errors?

Question56: Given the following Apex statement:
Account myAccount = [SELECT Id, Name FROM Account);
What occurs when more than one Account is returned by the SOQL query?

Question57: Which two characteristics are true for Lightning Web Component custom events?
Choose 2 answers

Question58: Which two actions may cause triggers to fire?
Choose 2 answers

Question59: Universal Hiring uses Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the master object, to Application_c acting as the detail.
Within the Job__c object, a custom multi-select picklist, preferred _Locations__c, contains a list of approved states for the position. Each Job_Application__c record relates to a Contact within the system through a master-detail relationship.
Recruiters have requested the ability to view whether the Contact's Mailing State value matches a value selected on the Preferred Locations__c field, within the Job_Application__c record. Recruiters would like this value to be kept in sync if changes occur to the Contact's Mailing State.
What is the recommended tool a developer should use to meet the business requirement?

Question60: A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names.
What two things should be done to create the test data within the unit test with the least amount of code?
Choose 2 answers

Question61: How should a developer write unit tests for a private method in an Apex class?

Question62: In the following example, which sharing context will myMethod execute when it is invoked?

Question63: A developer is integrating with a legacy on-premise SQL database.
What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?

Question64: A developer created these three Rollup Summary fields in the custom object, Project__c:
The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to implement the business requirement in order to minimize maintenance overhead?

Question65: What are three considerations when using the @lnvocableMethod annotation in Apex?
Choose 3 answers

Question66: When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?

Question67: Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1, 000,000. A developer created the following trigger on the Account object to satisfy this requirement.
for (Account a : Trigger.new) {
if (a.AnnualRevenue > 1000000) {
List<Opportunity> oppList = [SELECT Id FROM Opportunity WHERE AccountId = :a.Id]; if (oppList.size() == 0) { Opportunity oppty = new Opportunity(Name = a.Name, StageName = 'Prospecting', CloseDate = System.
today().addDays(30));
insert oppty;
}
}
}
Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, it fails with system, Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2. answers

Question68: A developer wants to mark each Account in a List<Account> as either Active or Inactive, based on the value in the LastModified each Account being greater than 90 days in the past.
Which Apex technique should the developer use?

Question69: A developer is asked to write helper methods that create test data for unit tests.

What should be changed in the TestUtils class so that its methods are only usable by unit test methods?

Question70: Universal Containers hires a developer to build a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field.
Which consideration should the developer be aware of when deciding between SOQL and SOSL?
Choose 2 answers

Question71: While writing an Apex class, a developer wants to make sure that all functionality being developed is handled as specified by the requirements.
Which approach should the developer use to be sure that the Apex class is working according to specifications?

Question72: Which two settings must be defined In order to update a record of a junction object?
Choose 2 answers

Question73: A lead developer creates a virtual class called "OrderRequest". Consider the following code snippet:
How can a developer use the OrderRequest class within the CustomerOrder class?

Question74: A Next Best Action strategy uses an Enhance element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors.
What is the correct definition of the Apex method?

Question75: Universal Containers wants a list button to display a Visualforce page that allows users to edit multiple records.
Which Visualforce feature supports this requirement?

Question76: A developer needs to confirm that a Contact trigger works correctly without changing the organization's data.
What should the developer do to test the Contact trigger?

Question77: A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineltem trigger.
Which method allows access to the price book?

Question78: A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violations to the user.
How can the developer make sure that validation rule violations are displayed?

Question79: Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers

Question80: Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.

When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page.
What can the developer use to meet this business requirement?

Question81: A developer created a Lightning web component called statuscomponent to be Inserted into the Account record page.
Which two things should the developer do to make this component available?
Choose 2 answers

Question82: Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.
The component should be able to validate the user input before saving the information to the database.
What is the best technology to create this component?

Question83: Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient.
The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address".
Which field should the developer add to create the most efficient model that supports the business need?

Question84: When importing and exporting data into Salesforce, which two statements are true?
Choose 2 answers

Question85: A developer created this Apex trigger that calls MyClass.mystaticMethod:
The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, resulting in
81% overall code coverage What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?

Question86: As part of new feature development, a developer is asked to build a responsive application capable of responding to touch events, that will be executed on stateful clients.
Which two technologies are built on a framework that fully supports the business requirement? Choose 2 answers

Question87: Universal Containers decides to use purely declarative development to build out a new Salesforce application.
Which two options can be used to build out the business logic layer for this application?
Choose 2 answers

Question88: Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering Support c.
Users should be able to associate multiple Engineering Support __c records to a single Opportunity record.
Additionally, aggregate information
about the Engineering Support _c records should be shown on the Opportunity record.
Which relationship field should be implemented to support these requirements?

Question89: A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner.
What is the most efficient way for a developer to implement this?

Question90: What is a considerations for running a flow in debug mode?

Question91: A developer is alerted to an issue with a custom Apex trigger that is causing records to be duplicated.
What is the most appropriate debugging approach to troubleshoot the issue?

Question92: A developer is creating an app that contains multiple Lightning web components.
One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page.
How should this be accomplished?

Question93: The Job _Application__c custom object has a field that is a master-detail relationship to the Contact object, where the Contact object is the master.
As part of a feature implementation, a developer needs to retrieve a list containing all Contact records where the related Account Industry is
'Technology', while also retrieving the Contact's Job_Application__c records.
Based on the object's relationships, what is the most efficient statement to retrieve the list of Contacts?
A)

B)
C)
D)

Question94: Which Apex class contains methods to return the amount of resources that have been used for a particular governor, such as the number of DML statements?