EMT Practice Test

1. Question Content...


Question List

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

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

Question3: A custom object Trainer_c has a lookup field to another custom object Gym___c.
Which SOQL query will get the record for the Viridian City gym and it's trainers?

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

Question5: What are three characteristics of change set deployments?
Choose 3 answers

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

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

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

Question9: Which salesforce org has a complete duplicate copy of the production org including data and configuration?

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

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

Question12: A developer identifies the following triggers on the Expense_c object:
DeleteExpense,
applyDefaultstoexpense
validateexpenseupdate;
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practice are followed?

Question13: Which exception type cannot be caught?

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

Question15: A custom picklist field, Food_Preference__c, exist 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 most efficient way to ensure a value is selected every time a record is saved?

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

Question17: A developer has a requirement to create an Order When an Opportunity reaches a "Closed-Won" status.
Which tool should be used to implement this requirement?

Question18: The following Apex method is part of the ContactService class that is called from a trigger: public static void setBusinessUnitToEMEA(Contact thisContact){ thisContact.Business_Unit__c = "EMEA" ; update thisContact; } How should the developer modify the code to ensure best practice are met?

Question19: When a user edits the Postal Code on an Account, a custom Account text field named ''Timezone'' must be updated based on the values in a postalCodeToTimezone_c custom object.
What should be built to implement this feature?

Question20: Which three statements are true regarding custom exceptions in Apex? (Choose three.)

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

Question22: developer created this Apex trigger that calls MyClass .myStaticMethod:
trigger myTrigger on Contact(before insert) ( MyClass.myStaticMethod(trigger.new, trigger.oldMap); } The developer creates a test class with a test method that calls MyClass.mystaticMethod, 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 exist?

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

Question24: How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i <
500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }
* 0
87. Boolean odk;
Integer x;
if(abok=false;integer=x;){
X=1;
}elseif(abok=true;integer=x;){
X=2;
}elseif(abok!=null;integer=x;){
X=3;
)elseif{
X=4;}

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

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

Question27: Which three resources in an Aura Component can contain Javascript functions? Choose 3 answers

Question28: What is the order of operations when a record is saved in Salesforce?

Question29: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?

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

Question31: 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 stock.
Which relationship implementation supports these requirements?

Question32: What are two ways a developer can get the status of an enquered job for a class that queueable interface?
Choose 2 answers

Question33: Which two characteristics are true for Aura component events?

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

Question35: Universal Containers recently transitioned from Classic to Lighting Experience. One of its business processes requires certain value from the opportunity object to be sent via HTTP REST callout to its external order management system based on a user-initiated action on the opportunity page. Example values are as follow
* Name
* Amount
* Account
Which two methods should the developer implement to fulfill the business requirement? (Choose 2 answers)

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

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

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

Question39: 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)

Question40: Universal Containers wants to back up all of the data and attachments in its Salesforce org once month. Which approach should a developer use to meet this requirement?

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

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

Question43: A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system.
Whithin the class, the developer identifies the following method as a security threat: List<Contact> performSearch(String lastName){ return Database.query('Select Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%); } What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers

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

Question45: Which aspect of Apex programming is limited due to multitenancy?

Question46: 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 the developer do to ensure a successful deployment?

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

Question48: Which two characteristics are true for Aura component events? Choose 2 answers

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

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

Question51: A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?

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

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

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

Question55: How many accounts will be inserted by the following block ofcode? for(Integer i = 0 ; i < 500; i++) { Account a = new Account(Name='New Account ' + i); insert a; }

Question56:
Which two examples above use the system. debug statements to correctly display the results from the SOQL aggregate queries? Choose 2 answers

Question57: What is the value of the Trigger.old context variable in a Before Insert trigger?

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

Question59: what are the three languages used in the visualforce page?

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

Question61: Which two statements are accurate regarding Apex classes and interfaces?
Choose 2 answers

Question62: A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is the correct implementation?

Question63: Which two statements true about Getter and Setter methods as they relate to Visualforce? Choose 2 answers

Question64: Universal Containers (UC) decided it will not to send emails to support personnel directly from Salesforce in the event that an unhandled exception occurs. Instead, UC wants an external system be notified of the error.
What is the appropriate publish/subscribe logic to meet these requirements?

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

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

Question67: What is the maximum number of SOQL queries used by the following code? List<Account> aList = [SELECT Id FROM Account LIMIT 5]; for (Account a : aList){ List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id); }

Question68: 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.

Question69: Universal container wants a list button to display a visualforce page that allows users to edit multiple records which visualforce feature supports this requirement.

Question70: Which code displays the contents of a Visualforce page as a PDF?

Question71: A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can override. What is the correct implementation of the ShippingCalculator class?

Question72: A Licensed_Professional__c custom object exist in the system with two Master-Detail fields for the following objects: Certification__c and Contact. Users with the "Certification Representative" role can access the Certification records they own and view the related Licensed Professionals records, however users with the
"Salesforce representative" role report they cannot view any Licensed professional records even though they own the associated Contact record. What are two likely causes of users in the "Sales Representative" role not being able to access the Licensed Professional records? Choose 2 answers

Question73: Which process automation should be used to send an outbound message without using Apex code?

Question74: A developer of Universal Containers is tasked with implementing a new Salesforce application that must be able to by their company's Salesforce administrator.
Which three should be considered for building out the business logic layer of the application? Choose 3 answers

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