EMT Practice Test

1. Question Content...


Question List

Question1: Which three operations affect the number of times a trigger can fire?
Choose 3 answers

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

Question3: Which two operations can be performed using a formula field? Choose 2 answers

Question4: What can used to delete components from production?

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

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

Question7: Which standard field is required when creating a new contact record?

Question8: A developer has an integer variable called maxAttempts. The developer meeds to ensure that once maxAttempts is initialized, it preserves its value for the lenght 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?

Question9: Which code displays the content of Visualforce page as PDF?

Question10: A developer wants to invoke on outbound message when a record meets aspecific criteria.
Which three features satisfy this use case?
Choose 3 answer

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

Question12: A workflow updates the value of a custom field for an existing Account.
How can a developer access the updated custom field value from a trigger?

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

Question14: A developer is asked to create a Visualforce page that displays some Account fields as well as fields configured on the page layout for related Contacts.
How should the developer implement this request?

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

Question16: A recursive transaction is limited by a DML statement creating records for these two objects:
1. Accounts
2. Contacts
The Account trigger hits a stack depth of 16.
Which statement is true regarding the outcome of the transaction?

Question17: Given the following trigger implementation:
trigger leadTrigger on Lead (before update){
final ID BUSINESS_RECORDTYPEID = '012500000009Qad';
for(Lead thisLead : Trigger.new){
if(thisLead.Company != null &&thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){ thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;
}
}
}
The developer receives deployment errors every time a deployment is attempted from Sandbox to Production.
What should thedeveloper do to ensure a successful deployment?

Question18: Which two events need to happen when deploying to a production org? Choose 2 answers

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

Question20: which statement is true regarding execution order when triggers are associated to the same object and event?

Question21: A developer needs to create a custom Interface in Apex.
Which three considerations must the developer keep in mind while developing the Apex Interface' Choose 3 answers

Question22: Universal Containers decides to use exclusively declarative development to build out a new Salesforce application. Which three options should be used to build out the database layer for the application? Choose 3 answers

Question23: A developer needs to prevent the creation of request records when certain conditions exist in the system. A RequestLogic class exists to checks the conditions. What is the correct implementation?

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

Question25: A developer created a Visualforce page and custom controller to display the account type field as shown below. Custom controller code: public class customCtrlr{ private Account theAccount; public String actType; public customCtrlr() { theAccount =[SELECT Id, Type FROM Account WHERE Id =
:apexPages.currentPage().getParameters().get('id')]; actType = theAccount.Type; } } Visualforce page snippet:
The Account Type is {!actType} The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is property referenced on the Visualforce page, what should the developer do to correct the problem?

Question26: An Approval Process is defined in the Expense_Item__c. A business rule dictates that whenever a user changes the Status to 'Submitted' on an Expense_Report__c record, all the Expense_Item__c records related to the expense report must enter the approval process individually. Which approach should be used to ensure the business requirement is met?

Question27: A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?

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

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

Question30: A developer is creating a 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. i, J Calculator How can the developer find the current user's default record type? ns

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

Question32: Which exception type cannot be caught ?

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

Question34: When importing and exporting data into Salesforce, whichtwo statements are true?
Choose 2 answers

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

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

Question37: What are two characteristics related to formulas? Choose 2 answers.

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

Question39: Where are two locations a developer can look to find information about the status of asynchronous or future cals? Choose 2 answers

Question40: what are the methods used to show input in classic and lightning ?

Question41: Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order will be imported into Salesforce.

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

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

Question44: Universal Containers stores the availability date on each Line Item of an Order and Orders are only shipped when all of the Line Items are available. Which method should be used to calculate the estimated ship date for an Order?

Question45: Which two statements are true about using the @testSetup annotation in an Apex test class?
Choose 2 answers

Question46: What are two ways that a controller and extension can be specified on a Visualforce page?
Choose 2 answers

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

Question48: 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 discussion, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able todo so. What is apossible reason that this change was not permitted?

Question49: Refer to the following code snippet for an environment has more than 200 Accounts belongingto the Technology' industry:

When the code execution, which two events occur as a result of the Apex transaction?
When the code executes, which two events occur as a result of the Apex transaction?
Choose 2 answers

Question50: What are two ways for a developer to execute tests in an org?

Question51: Which three resources in an Azure Component can contain JavaScript functions?

Question52: What should be used to create scratch orgs?

Question53: A Salesforce developer wants to review their code changes immediately and does not want to install anything on their computer or on the org.
Which tool is best suited?

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

Question55: Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?

Question56: Which two are phases in the Salesforce Application Event propagation framework? Choose
2 answers

Question57: While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.
How should the Developer overcome this problem?

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

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

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

Question61: Which three process automations can immediately send an email notification to the owner of an Opportunity when its Amount is changed to be greater than $10,000? Choose 3 answers

Question62: A developer must create an Apex class, contactcontroller, that a Lightning component can use to search for Contact records. User of the Lightning component should only be able to search Contact records to which they have access. Which two will restrict the records correctly?

Question63: A developer considers the following snippet of code:

Based on this code, what is the value of x?

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

Question65: A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

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