Platform Developer I Mock 4

Welcome to your Platform Developer I Mock 4

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

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?

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

The following Apex method is part of the ContactSertvice 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 practices are met?

A developer is tasked to perform a security review of the ContactSearch Apex class that exists in the system. Within the class, the developer identifies the following method as a security threat: List 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

A developer wants to retrieve the Contacts and Users with the email address 'dev@uc.com'. Which SOSL statement should the developer use?

Given the following block of code: try{ List retrievedRecords = '[SELECT Id FROM Account WHERE Website = null]; }catch(Exception e){ //manage exception logic } What should a developer do to ensure the code execution is disrupted if the list retrievedRecords remains empty after the SOQL query?

Given the following Anonymous Block: List casesToUpdate = new List( ); for(Case thisCase : [Select Id, Status FROM Case LIMIT 50000]){ thiscase. Status = 'Working'; casesToUpdate. add(thisCase); } try{ Database. update(casesToUpdate, false); }catch(Exception e){ System. debug(e. getMessage()); } What should a developer consider for an environment that has over 10,000 Case records?

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

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

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 practices are met?

A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public without sharing class OpportunityService{ public static List getOpportunityProducts(Set opportunityIds){ List oppLineItems = new List(); for(Id thisOppId : opportunityIds){ oppLineItems. addAll([Select Id FROM OppLineItem 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?

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

What are three capabilities of the tag when loading JavaScript resources in Aura components? Choose 3 answers

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

A developer must create a Lightning component that allows users to input Contact record information to create a Contact record, including a Salary__c custom field. What should the developer use, along with a lightning-record-edit-form, so that Salary__c field functions as a currency input and is only viewable and editable by users that have the correct field level permissions on Salary__c ?

Given the code below: List aList = '[SELECT Id FROM Account]; for(Account a : aList) { List cList = '[SELECT Id FROM Contact WHERE AccountId =:a.Id]; } What should a developer do to correct the code so that there is no chance of hitting a governor limit?

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?

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?

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?

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

A 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 exists?

A developer created a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the 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?

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

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

What are two way for a developer to execute tests in an org? Choose 2 answers

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

Which three statements are true regarding custom exceptions in Apex? Choose 3 answers

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?

What should be used to create scratch orgs?

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

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

Which two statements accurately represent the MVC framework implementation in Salesforce? Choose 2 answers

What is a benefit of developing applications in a multi-tenant environment?

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

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. How should a developer implement this feature?

An org has an existing Visual Flow that creates an Opportunity with an Update Records element. A developer must update the Visual Flow to also create a Contact and store the created Contact's ID on the Opportunity. Which update should the developer make in the Visual Flow?

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

A developer needs to implement the functionality for a service agent to gather multiple pieces of information from a customer in order to send a replacement credit card. Which automation tool meets these requirements?

Which aspect of Apex programming is limited due to multitenancy?

In terms of the MVC paradigm, what are two advantages of implementing the view layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers

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

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?

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

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

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

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?

What are two characteristics related to formulas? Choose 2 answers

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 max attempts to meet these requirements?

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?

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?

A Visual Flow 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?

Universal Containers recently transitioned from Classic to Lightning Experience. One of its business processes requires contain values from the Opportunity object to be sent via an HTTP REST callout to its external order management system based on a user-initiated action on the Opportunity detail page, Example values are as follows: Name Amount Account Which two methods should the developer implement to fulfill the business requirement?

A developer wrote the following two classes: public with sharing class statusFetcher{ private Boolean active = true; private Boolean isActive(){ return active; } } public with sharing class Calculator{ public void doCalculations() StatusFetcher sFetcher = new StatusFetcher(); if(sFetcher.isActive()) //do calculatlons here } } } The StatusFetcher class successfully complled and saved.However, the calculator class has a compile time error. How should the developer fix this code?

Given the code below in an Apex class: List aList=[SELECT Id, Active_c EROM Account]; for (Account a : a List){ if[!a.Active_c){ a.Name = 'INACTIVE'; } } update aList; What should a developer do to correct the code so that there is no chance of hitting a governor limit?

A lead developer creates an Apex interface called "Laptop". Consider the following code snippet: public class SilverLaptop{ //code implementaticn } How can a developer use the Laptop interface within the SilverLaptop class?

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. Annua1Revenue > 1000000){ List 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

A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search. Consider the following code snippet: @AuraEnabled public static List searchTerms(List termlist){ List result = new List() : for(string term: termList) { result.addAl1([FIND :term IN ALL FIELDS RETURNING Account Name), contact(FirstName,LastName)]}; } return result; } What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?

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?

Consider the following code snippet: public static List obtainAllFields(Set 1eadIds) { List result = new List(); for(Id leadId : leadIds) { result.add([SELECT FIELDS(ALL) FROM Lead WHERE Id = :leadId]; } return result; } 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?

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

Refer to the following code that runs in an Execute Anonymous block: for( List theseLeads : [SELECT LastName, Company, Email FROM Lead LIMIT 20000]) { for(Lead thisLead : theseLeads) { if(thisLead.Email == null) thisLead.Email = assignGenericEmail(thisLead.LastName, thisLead.Company); } Database.Update(theseLeads, false); } In an environment where the full result set is returned, what is a possible outcome of this code?