EMT Practice Test

1. Question Content...


Question List

Question1: Which two process automations can be used on their own to send Salesforce Outbound Message?
Choose 2 answers

Question2: A developer is creating a Visualforce page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record. How can the developer find the current user's default record type?

Question3: Which three web technologies can be integrated into a Visualforce page? (Choose three.)

Question4: Which option would a developer use to display the Accounts created in the current week and the number of related Contacts using a debug statement in Apex?

Question5: A newly hired developer discovers that there are multiple triggers on the case object.
What should the developer consider when working with triggers?

Question6: What is a benefit of the Lightning Component framework?Choose 3 answers

Question7: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. 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

Question8: Which two statements are true about Apex code executed in Anonymous Blocks? Choose 2 answers

Question9: A developer Is asked to create a Visualforce page that lists the contacts owned by the current user. This component will be embedded In a Lightning page.
Without writing unnecessary code, which controller should be used for this purpose?

Question10: A developer can use the debug log to see which three types of information? Choose 3 answers

Question11: What is a capability of formula fields? (Choose 3)

Question12: What actions types should be configured to display a custom success message?

Question13: A developer must create a CreditcardPayment class that provides an implementation of an existing Payment class. Public virtual class Payment { public virtual void makePayment(Decimal amount) { /*implementation*/
} } Which is the correct implementation?

Question14: Which type of controller should a developer use to include a list of related records for a Custom Object record on a Visualforce page without needing additional test coverage?

Question15: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the apex class, Bodyfat, and its method, calculateBodyfat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizer outside the ISV's package namespace. Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question16: A lead developer creates an Apex interface called "Laptop". Consider the following code snippet:

How can a developer use the Laptop Interface within the Silvertaptop class?

Question17: In order to override a standard action with a visualforce page, which attribute must be defined in the
<apex:page> tag?

Question18: A developer created these three Rollup Summary fields in the custom object, Project_ct,

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?

Question19: A business has a proprietary Order Management System (OMS) that creates orders from their website and ... the order. When the order is created in the OMS, an integration also creates an order record in Salesforce ... relates it to the contact as identified by the email on the order. As the order goes through different stages in OMS, the integration also updates it in Salesforce.
It is notified that each update from the OMS creates a new order record in Salesforce.
Which two actions prevent the duplicate order records from being created in Salesforce?
Choose 2 answers

Question20: In which two org types can a developer create new Apex Classes? Choose 2 answers

Question21: How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Question22: A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); } Which is the correct implementation to use the PaymentProcessor interface class?

Question23: A developer is creating an enhancement to an application that will allow people to be related to their employer.
Which date model should be used to track the data?

Question24: A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or update. The field update in the workflow rule is configured to not re-evaluate workflow rules. What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question25: A developer uses a loop to check each Contact in a list. When a Contact with the Title of
"Boss" is found, the Apex method should jump to the first line of code outside of the for loop.
Which Apex solution will let the developer implement this requirement?

Question26: Universal Containers stores Orders and Line Items in Salesforce. For security reason, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line items on the Order. Which type of relationship should be used?

Question27: What is an important consideration when developing in a multi-tenant environment?

Question28: What is a good practice for a developer to follow when writing a trigger? (Choose 2)

Question29: How can a developer determine, from the DescribeSObjectResult, if the current user will be able to create records for an object in Apex?

Question30: A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to execute complex validation involving several types of objects.
When creating the Apex method, which annotation should a developer use to ensure the method Can be used within the flow?

Question31: Which scenario is invalid for execution by unit tests?

Question32: What will be the output in the debug log in the event of a QueryExeption during a call to the @query method in the following Example?

Question33: A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required" What should the developer do to successfully deploy the new Apex trigger and helper class?

Question34: Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers

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

Question36: Assuming that 'name; is a String obtained by an <apex:inputText> tag on a Visualforce page.
Which two SOQL queries performed are safe from SOQL injections? Choose 2 answers

Question37: Application Events follow the traditional publish-subscribe model. Which method is used to fire an event?

Question38: A developer must provide a custom user interface when users edit a Contact. Users must be able to use the interface in Salesforce Classic and Lightning Experience. What should the developer do to provide the custom user interface?

Question39: How can a developer avoid exceeding governor limits when using an Apex Trigger?choose 2 answers

Question40: A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

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

Question42: What is accurate statement about with sharing keyword? Choose 2 answers

Question43: 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.
What should a developer Implement to support these requirements?

Question44: A developer needs to create a custom button for the Account object that, when clicked, will perform a series of calculation and redirect the user to a custom visualforce page.
Which three attributes need to be defined with values in the <apex:page> tag to accomplish this?
Choose 3 answers

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

Question46: A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?

Question47: A developer writes a single trigger on the Account object on the after insert and after update events. A workflow rule modifies a field every time an Account is created or updated.
How many times will the trigger fire if a new Account is inserted, assuming no other automation logic is implemented on the Account?

Question48: Given:
Map<ID, Account> accountMap = new Map>ID, Account> ([SELECT Id, Name FROM Account]); What are three valid Apex loop structures for iterating through items in the collection? (Choose three.)

Question49: Which three data types can a SOQL query return? Choose 3 answers

Question50: When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

Question51: An Apex method, getAccounts, that returns a List of Accounts given a search Term, is available for Lighting Web components to use. What is the correct definition of a Lighting Web component property that uses the getAccounts method?

Question52: Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers

Question53: A developer created a visualforce page using a custom controller that calls an apex helper class. A method in the helper class hits a governor limit. what is the result of the transaction?

Question54: What is a benefit of using a trigger framework?

Question55: Given the code below:

What should a developer do to correct the code so that there is no chance of hitting a governor limit?

Question56: What can be used to override the Account's standard Edit button for Lightning Experience7

Question57: Refer to the following code snippet for an environment that has more than 200 Accounts belonging to the Technology' industry:

which three statements are accurate about debug logs?
Choose 3 answers

Question58: A primaryid_c custom field exists on the candidate_c custom object. The filed is used to store each candidate's id number and is marked as Unique in the schema definition.
As part of a data enrichment process. Universal Containers has a CSV file that contains updated data for all candidates in the system, f he file contains each Candidate's primary id as a data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to a candidate in the system.
Which technique should the developer implement to streamline the data upload?

Question59: A developer has requirement to write Apex code to update a large number of account records on a nightly basis. The system administrator needs to be able to schedule the class to run after business hours on an as-needed basis.
Which class definition should be used to successfully implement this requirement?

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

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

Question62: A developer is asked to create a Visualforce page for Opportunities that allows users to save or merge the current record.
Which approach should the developer to meet this requirement?

Question63: What is the minimum log level needed to see user-generated debug statements?

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

Question65: A developer needs to avoid potential system problems that can arise in a multi-tenant architecture. Which requirement helps prevent poorty written applications from being deployed to a production environment?

Question66: A developer needs to implement a custom SOAP Web Service that is used by an external Web Application.
The developer chooses to Include helper methods that are not used by the Web Application In the Implementation of the Web Service Class.
Which code segment shows the correct declaration of the class and methods?
A)

B)

C)

D)

Question67: A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem> oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } } The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Question68: A developer needs to know if all tests currently pass in a Salesforce environment. Which feature can the developer use? (Choose 2)

Question69: What are three ways for 2 developer to execute tests in an org? Choose 3 answers

Question70: A developer is tasked with performing a complex validation using Apex as part of advanced business logic. certain criteria are met for a PurchaseOrder, the developer must throw a custom exception.
What is the correct way for the developer to declare a class that can be used as an exception?

Question71: What are two considerations for custom Apex Exception classes? Choose 2 answers.

Question72: Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

Question73: A developer needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?

Question74: A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:Account myAccount = new Account(Name = 'MyAccount');Insert myAccount;For (Integer x = 0; x <
150; x++)
{Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;} catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount');How many accounts are in the org after this code is run?

Question75: When are code coverage calculations updated?

Question76: A developer declared a class as follow.
public class wysiwyg { // Properties and methods including DML }
Which invocation of a class method will obey the organization-wide defaults and sharing settings for the running user in the Salesforce Organization?

Question77: Universal Containers has created a unique process for tracking container repairs. A custom field, status__c, has been created within the container__c custom object. A developer is tasked with sending notifications to multiple external systems every time the value of the status__picklist changes.
Which two tools should the developer use to meet the business requirement and ensure low maintenance of the solution?
Choose 2 answers

Question78: Which approach should be used to provide test data for a test class?

Question79: Refer to the following code that runs in an Execute Anonymous block:

Question80: When viewing a Quote, the sales representative wants to easily see how many discounted items are included in the Quote Line Items.
What should a developer do to meet this requirement?

Question81: What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

Question82: A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage. Production data is not required for the integration testing.
Which two environments meet the requirements for testing? (Choose two.)

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

Question84: Which scenario is valid for execution by unit tests?

Question85: What are three ways for a developer to execute tests in an org? Choose 3.

Question86: A developer is migrating a Visualforce page into a Lightning web component.
The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.
Which security consideration should the developer be aware of?

Question87: A sales manager wants to make sure that whenever an opportunity stage is changed to 'Closed Won', a new case will be of created for the support team to collect necessary information from the customer. How should a developer accomplish this?

Question88: A developer has the following code:try {List nameList;Account a;String s = a.Name;nameList.add(s);} catch (ListException le ) {System.debug(' List Exception ');} catch (NullPointerException npe) {System.debug(' NullPointer Exception ');} catch (Exception e) {System.debug(' Generic Exception ');} What message will be logged?

Question89: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question90: Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?

Question91: How should a custom user interface be provided when a user edits an Account in Lightning Experience?

Question92: Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page?
A)

B)

C)

D)

Question93: Given the following Anonymous Block:

Which one do you like?
What should a developer consider for an environment that has over10,000 Case records?

Question94: Considering the following code snippet:

When the code executes a DML exception is thrown.
How should the developer modify the code to ensure exceptions are handled gracefully?

Question95: What is a correct pattern to follow when programming in Apex on a Multi-tenant platform?

Question96: A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule also increments the count field every time that an Account is created or updated. The field update in the workflow rule is configured to not re-evaluate workflow rules.
What is the value of the count field if an Account is inserted with an initial value of zero, assuming no other automation logic is implemented on the Account?

Question97: Universal Container is building a recruiting app with an Applicant object that stores information about an individual person that represents a job. Each application may apply for more than one job.
What should a developer implement to represent that an applicant has applied for a job?

Question98: Which two sosl searches will return records matching search criteria contained in any of the searchable text fields on an object? choose 2 answers

Question99: Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage.
Which two strategies should a developer use to accomplish this? (Choose two.)

Question100: Universal Containers hires a developer to build a custom search page to help user- 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

Question101: A developer migrated functionality from JavaScript Remoting to a Lightning web component and ... existing getOpportunities method to provide data.

Question102: In Lightning component framework, which resource can be used to fire events? Choose 2 answers.