EMT Practice Test

1. Question Content...


Question List

Question1: What is a valid return type for the following SOSL query? [FIND 'map"' IN ALL FIELDS RETURNING Account (Id, Name) , Contact, Opportunity,Lead]

Question2: messages are rendering on the page. Which component should be added to the Visualforce page to display the message?

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

Question4: What is a limitation of a "getxxx" method (for example, getName) in a custom Visualforce controller?

Question5: A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order's shipping address is not numeric.
What is a recommended way for the error message be displayed to the end user?

Question6: A developer is writing a Jest for a Lightning web component that conditionally displays child components based on a user's checkbox selections.
What should the developer do to property test that the correct components display and hide for each scenario?

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

Question8: What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? (Choose two.)
<apex:commandFunction action="{!Save}" value="Save" rendered="thePageBlock"/>

Question9: Sometimes events on Salesforce need to be handled by an external system due to the scale or type of process being executed. Consider the use case of a user in Salesforce needing to get pricing for an order they are building in Salesforce while on the phone with a customer. The pricing logic already exists in a third-party system. Instead of recreating this logic in Salesforce, it will be leveraged by making a request of the third-party system. The response, in this case the pricing, will be returned and stored back in Salesforce. What is the optimal solution?

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

Question11: During the Visualforce Page execution, what step follows immediately after "Evaluate constructors on controller and extensions"?

Question12: A Lightning Component functions in preview mode and needs to be used inside a Lightning App Builder page, but it is not available. What change should be applied to the component?

Question13: Choose the correct definition for <apex:actionSupport>.

Question14: 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'?

Question15: A developer is trying to access org data from within a test class. Which sObject type requires the test class to have the (seeAllData=true) annotation?

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

B)

C)

D)

Question17: Which tag should a developer use to display different text while an <apex:commandButton> is executing versus not executing?

Question18: A developer is tasked with creating a Lightning web component that allows users to create a Case for a selected product, directly from a custom Lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.
Which two components should a developer use to implement the creation of the Case from the Lightning web component?
Choose 2 answers

Question19: UC Loans is a small company with a part time Salesforce administrator. UC Loans wants to create a Loan__c record whenever an Opportunity is won.
What is the optimal solution for UC Loans to accomplish this?

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

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

Question22: As part of a custom development, a developer creates a Lightning Component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:
* Amount Probability, Stage, or Close Date
What is the most efficient way to Query such information?

Question23: A company has a Lightning Page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data.
What can a developer use to analyze and diagnose the problem in the Lightning Page?

Question24: 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?
A)

B)

C)

D)

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

Question26: Which two relationship queries use the proper syntax? (Choose two.)
SELECT Id, Name, Account__r.Name FROM Contact WHERE Account__r.Industry

Question27: Which of the following about Dynamic Apex is incorrect?

Question28: Which two relationship queries use the proper syntax? Choose 2 answers

Question29: Choose the correct definition for <apex:actionPoller>.

Question30: A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours.
Which two steps should a developer take to accomplish this?
Choose 2 answers

Question31: What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method?

Question32: Refer to re code segment above.

When following best practices for writing Apex taggers, which two lots are wrong or cause for concern?
Choose 2 answers

Question33: A developer has a Visual force page that automatically assign ownership of an Account to a queue save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?

Question34: A developer receives a LimitException: Too many query rows: 50001 error when running code. What debugging approach using the Developer Console provides the fastest and most accurate mechanism to identify a specific component that may be returning an unexpected number of rows?

Question35: When developing a Visualforce page that will be used by a global organization that does business in many languages and many currencies, which feature should be used? (Choose three.)

Question36: 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'

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

Question38: Universal Containers has a Visualforce page that displays a table every Container_ c being rented by a gives Account.. failing because some of the customers rent over 100,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

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

Question40: An org has a custom object, Registeration_c that has a lookup relationship to the Opportunity object.
What should a developer use to create a stand-alone Vlsualforce page that displays the Registration__c records related to an Opportunity.

Question41: Which annotation exposes an Apex class as a RESTful neb service?

Question42: A developer is trying to access org data from within a test class. Which sObject type requires the test class to have the (seeAllData=true) annotation?

Question43: 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.
Exhibit.

What must be added to get the data?

Question44: 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 running into governor limits and system limitations?

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

Question46: Universal Containers has a Visualforce page that displays a table every Container_ c being rented by a gives Account.. failing because some of the customers rent over 100,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

Question47: 0f Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b. These are the fields on Customer_Transaction__b: Account__c Program__c Points_Earned__c Location__c Transaction_Date__c The following fields have been identified as Index Fields for the Customer_Transaction__b object: Account__c, Program__c, and Transaction_Date__c. Which SOQL query is valid on the Customer_Transaction__b Big Object?

Question48: trigger AssignOwnerByRegion on Account ( before insert, before update )
{
List<Account> accountList = new List<Account>();
for( Account anAccount : trigger.new )
{
Region__c theRegion = [
SELECT Id, Name, Region_Manager__c
FROM Region__c
WHERE Name = :anAccount.Region_Name__c
];
anAccount.OwnerId = theRegion.Region_Manager__c;
accountList.add( anAccount );
}
update accountList;
}
Consider the above trigger intended to assign the Account to the manager of the Account's region.
Which two changes should a developer make in this trigger to adhere to best practices? (Choose two.)

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

Question50: A Visualforce page needs to make a callout to get biding information and tax information from two different REST endpoints. The information needs to be Displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process.
How should a developer implement the callouts?

Question51: What is the transaction limit for the number of DML statements allowed?

Question52: Consider the following code snippet:

Which governor limit is likely to be exceeded when the trigger runs when a scope of 200 newly inserted accounts?

Question53: A Salesforce developer is hired by a multi-national company to build a custom Lightning application that shows employees their employment benefits and earned commissions over time. The application must acknowledge and respect the user's locale context for dates, times, numbers, currency, and currency symbols.
Which approach should the developer implement to ensure the Lightning application complies with the user's locale?

Question54: What is a controller value that will NOT be saved in the viewstate of a Visualforce page? Choose 3 answers

Question55: A company wants to create a dynamic survey that navigates users through a different series of questions based on their previous responses. What is the recommended solution to meet this requirement?

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

Question57: In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing? (Choose three.)

Question58: A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

Question59: A developer has created a Batchable class that inserts Accounts. The Batchable class is running with batch size of 200, and is getting an error. The developer identifies the following code as problematic. trigger AccountTrigger on Account(after insert) { for( Account a : Trigger.new) { AccountHandler.insertPartnerAccount(a); } } public Class AccountHandler{ @future public static void insertPartnerAccount(Account a){ //perform processing if( a.Is_Partner__c) { Account partnerAccount = new Account(); //set values insert partnerAccount; } } } What governor limit or system limitation is the developer most likely violating?

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

Question61: A business process requires sending new Account records to an external system. The Account Name, Id, CreatedDate. and CreatedByld must be passed to the external system in near real-time when an Account is Inserted without error.
How should a developer achieve this?

Question62: 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 two.)

Question63: A developer writes the following code:

While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.)

Question64: A developer has created an Order entry page that includes an <apex:outputLabel> tag for a field label. How can the developer ensure that the label text changes when the field label changes?

Question65: Which is a valid Apex REST Annotation? (Choose two.)

Question66: A developer is writing a Visualforce page to display a list of all of the checkbox fields found on a custom object.
What is the recommended mechanism the developer should use to accomplish this?

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

Question68: What is the optimal syntax for adding a link to a case in a Visualforce page? Choose 2 answers

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

Question70: Choose the correct definition for <apex:pageMessage>

Question71: Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce. The flow of data is as follows: * The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds. If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds. * If a match is not found, the integration will create a Lead and a Task for that newly created Lead. What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24-hour period?

Question72: Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates?
Choose 3 answers

Question73: Which statement is true about using ConnectApi namespace (also called Chatter in Apex)? (Choose two.)

Question74: A company has a native i0S 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?

Question75: A developer 15 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 arm two approaches a developer can take to build the application and support the business requirements?
Choose 2 answers

Question76: Example 1: AggregateResult[] groupedResults = [SELECT Campaignid, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResuits) { System.debug ('Campaign ID' + ar.get('CampaignId'-); System.debug ('Average amount' + ar.get('exprd')); } Example 2: AggregateResult[] groupedResults = [SELECT Campaignid, AVG(Amount) theAverage FROM Opportunity GROUP BY Campaignid]; for (AggregateResult ar : groupedResuits) { System.debug(*Campaign ID' + ar.get('CampaignId')); System.debug ('Average amount' + ar.get('theAverage')); } Example 3: AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId]; for (AggregateResult ar : groupedResuits) System.debug(*Campaign ID' + ar.get('CampaignId')); System.debug('Average amount' + ar.get.AVG(-); } Example 4:AggregateResult[] groupedResults = [SELECT CampaigniId, AVG(Amount) theAverage FROM Opportunity GROUP BY Campaignid]; for (AggregateResult ar : groupedResults) { System.debug('Campaign ID' + ar.get('CampaignId')); System.debug ('Average amount' + ar.theAverage-; } Which two of the examples above have correct System.debug statements? Choose 2 answers

Question77: A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records. How should the developer handle the recursive trigger?

Question78: If the "PageReference.setRedirect" Apex function is set to True, what type of request is made?

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

Question80: What is the optimal syntax for adding a link to a case in a Visualforce page? (Choose two.)
<apex:outputLink value="{$URLFOR($Action.Case.Open, case)}" target="blank">

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

Question82: REST uses___________.

Question83: Assuming the CreateOneAccount class creates one account and implements the Queuetable interface, which syntax tests the Apex code?
A)

B)

C)

D)

Question84: 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?
A)

B)

C)

D)

Question85: When should a developer use the transient keyword? Choose 2 answers

Question86: Developer wishes to improve runtime performance of Apex calls by caching results on the client. What is the best way to implement this?

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

Question88: The "Webservice" keyword __________.

Question89: A developer is trying to access org data from within a test class. Which sObject type requires the test class to have the (seeAllData=true) annotation?

Question90: 0f Universal Containers uses Big Objects to store almost a billion customer transactions called Customer_Transaction__b. These are the fields on Customer_Transaction__b: Account__c Program__¢ Points_Earned__c Location__c Transaction_Date__c The following fields have been identified as Index Fields for the Customer_Transaction__b object: Account__c, Program__c, and Transaction_Date__c. Which SOQL query is valid on the Customer_Transaction__b Big Object?

Question91: If you wanted to create a record following the update of another (with data from the source object), what is the most customizable approach?

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

Question93: Lightning Aura Component

Lightning Aura Controller

Apex Controller

Given the code above, which two changes need to be made in the Apex Controller for the code to work?
(Choose two.)

Question94: Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

Question95: 35. A user receives the generic "An internal server error has occurred" while interacting with a custom Lightning Component. What should the developer do to ensure a more meaningful message?

Question96: Which statement is true about Apex web service methods? Choose 3 answers

Question97: A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired. What is the optimal way to accomplish this?

Question98: Ursa Major Solar has a custom object, serviceJcb__c, with an optional Lookup field to Account called Partr,er_service_Provider__c.
The TocaUobs__c field on Account tracks the total number of serviceJcb__o 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?

Question99: Which use case is an appropriate fit for the @future asynchronous Apex method? (Choose two.)

Question100: Which method should be used to convert a Date to a String in the current user's locale?

Question101: A developer is asked to build a solution that will automatically send an email to the Customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after all Workflow Rules have fired.
What is the optimal way to accomplish this?

Question102: In which of the following scenarios would it be acceptable to use programmatic sharing instead of declarative sharing?

Question103: A developer wants to write a generic Apex method that will compare the Salesforce Name filed 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.
How should the developer do this?

Question104: A developer must create a custom pagination solution. Users will access the solution on a mobile device and will rarely access subsequent pages of records. Performance is crucial. Which approach is optimal?