Platform Developer I Mock 3 09/12/2022 by Miquel Espinosa 0 Comments Welcome to your Platform Developer I Mock 3 Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner? Set the attribute enableLightning to true in the definition. Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript applications. Enable Available for Lightning Experience, Lightning Communities, and the mobile app on Visualforce pages used by the custom application. Rewrite all Visualforce pages as Lightning components. Ninguna 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? Declare the class and method using the global access modifier. Declare the class and method using the public access modifier. Declare the class as global and use the public access modifier on the method. Declare the class as public and use the global access modifier on the method. Ninguna A developer needs to prevent the creation of Request records when certain exist in the system. A RequestLogic class exists that checks the conditions. What is the correct implementation? trigger RequestTrigger on Request (before insert){ RequestLogic.validateRecords(trigger.new); } trigger RequestTrigger on Request (after insert){ RequestLogic.validateRecords(trigger.new); } trigger RequestTrigger on Request (after insert){ if(RequestLogic.isValid(Request)) request.addError('Your request cannot be created at this time.'); } trigger RequestTrigger on Request (before insert){ if(RequestLogic.isValid(Request)) request.addError('Your request cannot be created at this time.'); } Ninguna If Apex code executes inside the execute() method of an Apex class when implementing the Batchable interface, which two statement are true regarding governor limits? Choose 2 answers The Apex governor limits are reset for each iteration of execute() method. The Apex governor limits cannot be exceeded due to the asynchronous nature of the transaction. The Apex governor limits might be higher due to the asynchronous nature of the transaction. The Apex governor limits are relaxed while calling the constructor of the Apex class. 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? The query fails and an error is written to the debug log. The first Account returned is assigned to myAccount. The variable, myAccount, is automatically cast to the List data type. An unhandled exception is thrown and the code terminates. Ninguna A recursive transaction is initiated 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? The transaction fails and all the changes are rolled back. The transaction succeeds as long as the Contact trigger stack depth is less than 16. The transaction succeeds and all changes are committed to the database. The transaction fails only if the Contact trigger stack depth is greater or equal to 16. Ninguna Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developer with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report can see Accounts they do not own. What should the developer use to enforce sharing permissions for the currently logged-in user while using the custom search tool? Use the with sharing keyword on the class declaration. Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user. Use the without sharing keyword on the class declaration. Use the schema describe calls to determine if the logged-in user has access to the Account object. Ninguna A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable. Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions? accountRec.isDeletable() Schema.sObjectType.Account.isDeletable() accountRec.sObjectType.isDeletable() Account.isDeletable() Ninguna Which Salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required? Calendar Events Event Monitoring Log Developer Log Asynchronous Data Capture Events Ninguna 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? public class DrawList implements Sortable, implements Drawable{ public void sort() { /*implementation*/ } public void draw(){ /*implementation*/ } } public class DrawList extends Sortable, Drawable{ public void sort() { /*implementation*/ } public void draw(){ /*implementation*/ } } public class DrawList extends Sortable, extends Drawable{ public void sort() { /*implementation*/ } public void draw(){ /*implementation*/ } } public class DrawList implements Sortable, Drawable{ public void sort() { /*implementation*/ } public void draw(){ /*implementation*/ } } Ninguna Which exception type cannot be caught? A Custom Exception NoAccessException CalloutException LimitException Ninguna 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? Override the Contact's Edit button with a Lightning page in Salesforce Classic and a Visualforce page in Lightning Experience. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. Override the Contact's Edit button with a Visualforce page in Salesforce Classic and a Lightning page in Lightning Experience. Override the Contacts's Edit button with a Lightning component in Salesforce Classic and a Lightning component in Lightning Experience. Ninguna A developer has an Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability? String.escapeSingleQuotes(ApexPages.currentPage().getParameters().get('url_param')) ApexPage.currentPage().getParameters().get('url_param') String.ValueOf(ApexPages.currentPage().getParameters().get('url_param')) ApePages.currentPage().getParameters().get('url_param').escapeHtml4() Ninguna Which two are phases in the Salesforce Application Event propagation framework? Choose 2 answers Control Default Bubble Emit Application Events follow the traditional publish-subscribe model Which method is used to fire an event? fire() emit() fireEvent() registerEvent() Ninguna 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? break continue return System.assert(false) Ninguna What does the Lightning Component framework provide to developers? Extended governor limits for applications Templated to create custom components Prebuilt components that can be reused Support for Classic and Lightning UIs Ninguna A custom Visualforce controller calls the ApexPages . addNessage() method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message? Ninguna For which three items can a trace flag be configured? Choose 3 answers Process Builder Visualforce Apex Class User Apex Trigger A developer wrote Apex code that calls out to an external system. How should a developer write the test to provide test coverage? Write a class that extends HTTPCalloutMock. Write a class that extends WebserviceMock. Write a class that implements the HTTPCalloutMock interface. Write a class that implements WebserviceMock. Ninguna When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs? Environment Hub Production Sandbox Dev Hub Ninguna A developer needs to confirm that a Contact works correctly without changing the organization's data. What should the developer do to test the Contact trigger? Use Deploy from the VSCode IDE to deploy an 'insert Contact' Apex class. Use the Test menu on the Developer Console to run all tests classes for the Contact trigger. Use the Open Execute Anonymous feature on the Developer Console to run an 'insert Contact' DML statement. Use the New button on the Salesforce Contacts Tab to create a new Contact record. Ninguna How should a developer write unit tests for a private method in an Apex class? Add a test method in the Apex class. Use the TestVisible annotation. Use the SeeAllData annotation. Mark the Apex class as global. Ninguna A development team wants to use a deployment script to automatically deploy to a sandbox during their deployment cycles. Which tool should they use to deploy to the sandbox? Ant Migration Tool Developer Console VSCode Change Sets Ninguna Which Salesforce org has a complete duplicate copy of the production org including data and configuration? Developer Pro Sandbox Production Partial Copy Sandbox Full Sandbox Ninguna What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface? Choose 2 answers Query the AsyncApex Job object View the Apex Jobs Page View the Apex Status Page View the Apex Flex Queue What are three ways for a developer to execute tests in an org? Choose 3 answers Metadata API Bulk API SalesforceDX Tooling API Developer Console A team of many developers work in their own individual orgs that have the same configuration as the production org. Which type of org is best suited for this scenario? Developer Edition Partner Developer Edition Full Sandbox Developer Sandbox Ninguna 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 ? lightning-input-field field-name="Salary__c" /lightning-input-field lightning-input-currency value="Salary__c" /lightning-input-currency lightning-input type="number" value="Salary__c" formatter="currency" /lightning-input lightning-formatted-number value="Salary__c" format-style="currency" /lightning-formatted-number Ninguna A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what is 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? public class CheckPaymentProcessor extends PaymentProcessor { public void pay (Decimal amount) { } } public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount); } public class ChecpaymentProcessor extends PaymentProcessor { public void pay(Decimal amount); } public class CheckPaymentProcessor implements PaymentProcessor { public void pay(Decimal amount) { } } Ninguna A custom picklist field Food_Preference__c, exists as 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. Mark the field as Required on the object's page Layout. Mark the field as Required on the field definition. Set "Use the first value in the list as default value" as True. Set a validation rule to enforce a value is selected. Ninguna An org tracks customer orders on an Order object and the line items of an Order on the Line Item object. The Line Item object has a Master/Detail relationship to the Order object. A developer has requirement to calculate the order amount on an Order and the line amount on each Line Item based on quantity and price. What is the correct implementation? Write a process an the Line Item that calculated the item amount and order amount and updates the fields on the Line Item and the Order. Implement the line amount as a numeric formula field and the order amount as a roll-up summary field. Implement the line amount as a currency field and the order amount as SUM formula field. Write a single before trigger on the Line Item that calculates the item amount and updates the order amount on the Order. Ninguna Universal Containers used a simple Order Management app. On the Order Lines, the order line total is calculated by multiplying the item price with the quantity ordered. There is a Master-Detail relationship between the Order and the Order Lines object. What is the best practice to get the sum of all order line totals on the order header? Apex Trigger Declarative Roll-Up Summary App Process Builder Roll-Up Summary Field Ninguna Universal Containers stores Orders and Line Items in Salesforce. For security reasons, financial representatives are allowed to see information on the Order such as order amount, but they are not allowed to see the Line Item on the Order. Which type of relationship should be user? Indirect Lookup Lookup Master-Detail Direct Lookup Ninguna A developer must build an application that tracks which Accounts have purchased specific pieces of equipment that are represented as Products Each Account could purchase many pieces of equipment. How should the developer track that an Account has purchased a piece of equipment? Use a Lookup on Account to Product Use the Asset object Use a Master-Detail on Product to Account Use a Custom object Ninguna UC wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address. The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called "Global Address". Which field should the developer add to create the most efficient model that supports the business need? Add a Master-Detail field on the Global Address object to the Account object. Add a Lookup field on the Account object to the Global Address object. Add a Master-Detail field on the Account object to the Global Address object. Add a Lookup field on the Global Address object to the Account object. Ninguna A Licensed_Professional __c custom object exists 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 "Sales 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 The organization has a private sharing model for Certification__c, and Contact is the primary relationship in the Licensed_Professional__c object. The organization has a private sharing model for Certification__c, and Certification__c is the primary relationship in the Licensed_Professional__c object. The organization recently modified the Sales Representative role to restrict Read/Write access to Licensed_Professional__c. The organization recently modified the Sales Representative role to restrict Read access to Licensed_Professional__c. A developer has the following requirements: Calculate the total amount on an Order. Calculate the amount for each Line Item based on quantity selected and price. Move Line Items to a different Order if a Line Item is not in stock. Which relationship implementation supports these requirements? Line Item has a Master-Detail field to Order and the Master can be re-parented. Order has a Lookup field to Line Item and there can be many Line Item per Order. Line Item has a Lookup field to Order and there can be many Line Item per Order. Order has a Master-Detail field to Line Item and there can be many Line Item per Order. Ninguna 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 discussions, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able to do so. What is possible reason that this change was not permitted? The Vendor object must use a Master-Detail field for reporting. The Account object is included on a workflow on the Vendor object. The Account records contain Vendor roll-up summary fields. The Vendor records has existing values in the Account object. Ninguna In the Lightning UI, where should a developer look to find information about a Paused Flow Interview? In the system debug log by filtering on Paused Flow Interview On the Paused Flow Interviews related list for a given record On the Paused Flow Interviews component on the Home page In the Paused Interviews section of the Apex Flex Queue Ninguna What are two benefits of using declarative customizations over code? Choose 2 answers Declarative customizations automatically update with each Salesforce release. Declarative customizations cannot generate run time errors. Declarative customizations automatically generate test classes. Declarative customizations generally require less maintenance. UC wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation. What are two characteristics of declarative development over programmatic customization? Choose 2 answers Declarative development has higher design limits and query limits. Declarative development can be done using the Setup UI. Declarative development does not require maintenance. Declarative development does not require Apex test classes. UC 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 Validation Rules Remote Actions Process Builder Flow Builder Batch Jobs Which two types of process automation can be used to calculate the shipping cost for an Order when the Order is placed and apply a percentage of the shipping cost to some of the related Order Products? Choose 2 answers Process Builder Approval Process Workflow Rule Flow Builder 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 discussions, the UC administrator tried to change the Master-Detail relationship to a Lookup relationship but was not able to do so. What is possible reason that this change was not permitted? The Vendor object must use a Master-Detail field for reporting. The Account object is included on a workflow on the Vendor object. The Account records contain Vendor roll-up summary fields. The Vendor records has existing values in the Account object. Ninguna Which two operations can be performed using a formula field? Choose 2 answers Displaying the last four digits of an encrypted Social Security number. Triggering a Process Builder. Displaying an Image based on the Opportunity Amount. Calculating a score on a Lead based on the information from another field. What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers Only one method using the @InvocableMethod annotation can be defined per Apex class. A method using the @InvocableMethod annotation must be declared as static. A method using the @InvocableMethod annotation must define a return value. A method using the @InvocableMethod can have multiple input parameters. A method using the @InvocableMethod annotation can be declared as Public or Global. A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debitAmount' should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2 answers Use the final keyword and assign its value in the class constructor. Use the static keyword and assign its value in the class constructor. Use the static keyword and assign its value in static initializer. Use the final keyword and assign its value when declaring the variable. A developer identifies the following triggers on the Expense__c object: deleteExpense; applyDefaultsToExpense; validateExpenseUpdate; The triggers process before delete, before insert, and before update event respectively. Which two techniques should the developer implement to ensure best practices are followed? Choose 2 answers Unify all three triggers in a single trigger on the Expense__c object that includes all events. Create helper classes to execute the appropriate logic when a record is saved. Maintain all three triggers on the Expense__c object, but move the Apex logic out of the trigger definition. Unify the before insert and before update triggers and use Process Builder for the delete action. 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? [SELECT Id, (SELECT Id FROM Job_ Application__ c) FROM Contact WHERE Accounts. Industry = 'Technology']; [SELECT Id, (SELECT Id FROM Job_ Application__ c) FROM Contact WHERE Account. Industry = 'Technology']; [SELECT Id, (SELECT Id FROM Job_ Application__ r) FROM Contact WHERE Account. Industry = 'Technology']; [SELECT Id, (SELECT Id FROM Job_ Application__ r) FROM Contact WHERE Accounts. Industry = 'Technology']; Ninguna A developer is debugging the following code to determine why Account are not being created. Account a = new Account(Name='A'); Database.insert(a, false); How should the code be altered to help debug the issue? Collect the insert method return value in a SaveResult record. Add a System.debug() statement before the insert method. Add a try/catch around the insert method. Set the second insert method parameter to TRUE. Ninguna A developer considers the following snippet of code: Boolean isOK; Integer x; String theString = 'Hello'; if(isOk == false && theString == 'Hello'){ x=1; }else if(isOK == true && theString == 'Hello'){ x=2; }else if(isOk == null && theString == 'Hello'){ x=3; }else{ x=4; } Based on this code, what is the value of x? 2 1 4 3 Ninguna A developer has to identify a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database. Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits? Choose 2 answers Use the Database.Savepoint method to enforce database integrity. Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL. Use the System.Limit class to monitor the current CPU governor limit consumption. Use Partial DML statements to ensure only valid data is committed. 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 overrude. What is the correct implementation of the ShippingCalculator class? public abstract class ShippingCalculator{ public abstract calculate(){ /*implementation*/} } public abstract class ShippingCalculator{ public void calculate(){ /*implementation*/} } public abstract class ShippingCalculator{ public virtual void calculate(){ /*implementation*/} } public abstract class ShippingCalculator{ public override calculate(){ /*implementation*/} } Ninguna Which three data types can a SOQL query return? Choose 3 answers Long sObject List Integer Double A developer has a requirement to create a Case when a record on the Complaint__c object is created. Which two ways can this be solved? Choose 2 answers Create a flow that initiates a new Case. Use platform events add create a trigger on after insert of the Complaint__c record to create the Case. Create a Lightning Component that listens for the event and calls an Apex method to create the Case Create a Process Builder that triggers when a Complaint__c record is created, and create the Case. 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 receivers deployment errors every time a deployment is attempted from Sandbox to Production. What should the developer do to ensure a successful deployment? Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components. Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment. Ensure the deployment is validated by a System user on Production. Ensure BUSINESS_RECORDTYPEID is retrieved using Schema Describe calls. Ninguna Universal Containers(UC) decides 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? Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using CometD. Have the external system subscribe to the BatchApexError event, no publishing is necessary. Publish the error event using the addError() method and write a trigger to subscribe to the event and notify the external system. Publish the error event using the addError() method and have the external system subscribe to the event suing CometD. Ninguna Time's up