Platform Developer I Mock 5 09/12/2022 by Miquel Espinosa 0 Comments Welcome to your Platform Developer I Mock 5 1. Cloud Kicks has a multi-screen flow that its call center agents use when handling inbound service desk calls. At one of the steps in the flow, the agents should be presented with a list of order numbers and dates that are retrieved from an external order management system in real time and displayed on the screen. What should a developer use to satisfy this requirement? An invocable method An outbound message An Apex controller An Apex REST class Ninguna 2. 0 1 2 3 Ninguna 3. 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 implements the HTTPCalloutMock interface Write a class that implements WebserviceMock Write a class that extends HTTPCalloutMock Write a class that extends WebserviceMock Ninguna 4. A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to execute a 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? @InvocableMethod @RemoteAction @future @AuraEnabled Ninguna 5. What should a developer use to script the deployment and unit test execution as part of continuous Integration? Salesforce CLI VS Code Developer console Execute Anonymous Ninguna 6. 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 The with sharing keyword must be used to enforce sharing rules Lightning Data Service ignores field-level security The isAccessible() method must be used for field-level access checks Lightning Data Service handles sharing rules and field-level security Ninguna 7. Total number of SOQL queries issued Total number of records processed as a result of DML statements Total number of DML statements issued Total number of records retrieved by SOQL queries Ninguna 8. A developer created a Lightning web component called statusComponent to be inserted into the Account record page. Which two things should the developer do to make this component available? Choose 2 answers. Add Account to the statusComponent.js-meta.xml file Add lightning__RecordPage> to the statusComponent.js file Add lightning__RecordPage to the statusComponent.js-meta.xml file Add true to the statusComponent.js-meta.xml file 9. A developer is creating a Lightning web component to show a list of sales records. The Sales Representative user should be able to see the comission field on each record. The Sales Assistant user should be able to see all fields on the record except the comission field. How should this be enforced so that the component works for both users without showing any errors? Use WITH_SECURITY_ENFORCED in the SOQL that fetches the data for the component. Use Lightning Locker Service to enforce sharing rules and field-level security Use Security.stripInaccessible to remove fields inaccessible to the current user. Use Lightning Data Service to get the collection of sales records. Ninguna 10. Which three steps allow a custom SVG to be included in a Lightning web component? Choose 3 answers Reference the variable in the """" template (correct) Upload the SVG as a static resource Import the static resource and provide a variable for it in JavaScript Import the SVG as a content asset file Reference the import in the HTML template 11. Universal Containers has a support process that allows users to request support from its engineering team using 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? Lookup field from Engineering_Support__c to Opportunity Master-detail field from Engineering_Support__c to Opportunity Master-detail field from Opportunity to Engineering_Support__c Lookup field from Opportunity to Engineering_Support__c Ninguna 12. Which two characteristics are true for Aura component events? Choose 2 answers Depending on the current propagation phase, calling event.stopPropagation() may not stop the event propagation. By default, containers can handle events thrown by components they contain The event propagates to every owner in the containment hierarchy If a container component needs to handle a component event, add a includeFacets="true" attribute to its handler. 13. Which two statements are true about Getter and Setter methods as they relate to Visualforce? Choose 2 answers Getter methods must be named get Variable and Setter methods must be named set Variable A corresponding Setter method is required for each Getter method Setter methods always have to be declared global Getter methods pass values from a controller to page 14. Universal Container uses Salesforce to create orders. When an order is created, it needs to sync with the in-house order fulfillment system. The order fulfillment system can accept SOAP messages over HTTPS. If the connection fails, messages should be retried for up to 24 hours. What is the recommended approach to sync the orders in Salesforce with the order fulfillment system? Use Process Builder to call an invocable Apex method that sends a message to the order fulfillment system Set up a Workflow Rule outbound message to the order fulfillment system Create an after insert trigger on the Order object to make a callout to the order fulfillment system Write an Apex SOAP service to integrate with the order fulfillment system. Ninguna 15. A developer created these three roll-up summary fields on the custom object, Project__c: Total_Timesheets__c Total_Approved_Timesheets__c Total_Rejected_Timesheet__c The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project. What are two benefits of choosing a formula field instead of an Apex trigger to fulfill the request? Choose 2 answers A formula field will trigger existing automation when deployed A formula field will calculate the value retroactively for existing records Using a formula field reduces maintenance overhead A test class that validates the formula field is needed for deployment. 16. A developer created a child Lightning web component nested inside a parent Lightning web component. The parent component needs to pass a string value to the child component. In which two ways can this be accomplished? The parent component can use a public property to pass the data to the child component The parent component can invoke a method in the child component The parent component can use a custom event to pass the data to the child component The parent component can use the Apex controller class to send data to the child component 17. Which two settings must be defined in order to update a record of a junction object? Choose 2 answers Read/Write access on the secondary relationship Read/Write access on the junction object Read access on the primary relationship Read/Write access on the primary relationship 18. The record will be created and a message will be in the debug log The record will not be created and no error will be reported The record will not be created and an exception will be thrown The record will be created and no error will be reported Ninguna 19. 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? 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 a 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 Write a process on the Line Item that calculates the Item amount and order amount and updates the field on the Line Item and the Order Ninguna 20. Which scenario is valid for execution by unit tests? Load data from a remote site with a callout Generate a Visualforce PDF with getContentAsPDF() Execute anonymous Apex as a different user. Set the created date of a record using a system method Ninguna 21. Collect the insert method return value in a SaveResult record Add a try/catch around the insert method Set the second insert method parameter to TRUE Add a System.debug() statement before the insert method Ninguna 22. Which two sfdx commands can be used to add testing data to a Developer sandbox? Choose 2 answers force:data:async:upsert force:data:tree:import force:data:bulk:upsert force:data:object:create 23. Make the doCalculations method in the Calculator class private Make the isActive method in the StatusFetcher class public Change the class declaration for the StatusFetcher class to public with inherited sharing Change the class declaration for the Calculator class to public with inherited sharing Ninguna 24. The following automations already exist on the Account object: A workflow rule that updates a field when a certain criteria is met, A custom validation on a field, and A flow that updates related contact records. A developer created a trigger on the Account object. What should the developer consider while testing the trigger code? The trigger may fire multiple times during a transaction A workflow rule field update will cause the custom validation to run again Workflow rules will fire only after the trigger has committed all DML operations to the database The flow may be launched multiple times. Ninguna 25. The deployment passes because the Apex code has the required >75% code coverage The deployment fails because the Apex trigger has no code coverage The deployment fails because no assertions were made in the test method The deployment passes because both classes and the trigger were included in the deployment Ninguna 26. Get Cloudy Consulting (GCC) has a multitude of servers that host its customers' websites. GCC wants to provide a servers status page that is always on display in its call center. It should update in real time with any changes made to any servers. To accommodate this on the server side, a developer created a Server Update platform event. The developer is working on a Lightning web component to display the information. What should be added to the Lightning web component to allow the developer to interact with the Server Update platform event? import { subscribe, unsubscribe, onError } from 'lightning/MessageChannel' import { subscribe, unsubscribe, onError } from 'lightning/ServerUpdate' import { subscribe, unsubscribe, onError } from 'lightning/pubsub' import { subscribe, unsubscribe, onError } from 'lightning/empApi' Ninguna 27. Universal Containers uses Service Cloud with a custom field, stage_c, on the Case object. Management wants to send a follow-up email reminder 6 hours after the stage_c field is set to "Waiting on Customer". The Salesforce Administrator wants to ensure the solution used is bulk safe. Which automation tool should a developer recommend to meet these business requirements? Einstein Next Best Action Process Builder Scheduled Flow Record-Triggered Flow 28. The code below deserializes input into a list of Accounts. Which code modification should be made to insert the Accounts so that field-level security is respected? 01: public with sharing class AcctCreator 05: if (sObjectType.Account.isCreatable()) 05: accts = Database.stripInaccessible(accts, Database.CREATABLE); 05: sObjectAccessDecision sd = Security.stripInaccessible(AccessType.CREATABLE, accts); Ninguna 29. 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? Standard controller Standard list controller Lightning controller Custom controller Ninguna 30. Check if all the required fields for Opportunity are being added on creation. Use Database.query to query the opportunities Query for existing opportunities outside of the for loop Move the DML that saves opportunities outside of the for loop 31. A third-party vendor created an unmanaged Lightning web component. The Salesforce Administrator wishes to expose the component only on Record Page Layouts. Which two actions should the developer take to accomplish the business objective? Specify lightningCommunity__Page Layout as a target in the XML file Ensure isExposed is set to true on the XML file Specify lightningCommunity__Page as a target in the XML file Specify lightning__RecordPage as a target in the XML file 32. A developer created a trigger on the Account object and wants to test if the trigger is properly bulkified. The developer team decided that the trigger should be tested with 200 account records with unique names. What two things should be done to create the test data within the unit test with the least amount of code? Choose 2 answers. Use the @isTest (isParallel=true) annotation in the test class Create a static resource containing test data Use Test.loadData to populate data in your test methods Use the @isTest (seeAllData=true) annotation in the test class 33. 5 6 10 15 Ninguna 34. A developer is creating an app that contains multiple Lightning web components. One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page. How should this be accomplished? Fire a notification Update a property on the parent Call a method in the Apex controller Create a custom event. Ninguna 35. 20 150 200 2000 Ninguna 36. What are two locations a developer can look to find information about the status of batch or future methods? Apex Flex Queue Paused Flow Interviews component Time-Based Workflow Monitor Apex Jobs 37. 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? public abstract class ShippingCalculator { public void calculate() { /*implementation*/ } public abstract class ShippingCalculator { public override calculate() { /*implementation*/ } public abstract class ShippingCalculator { public abstract calculate() { /*implementation*/ } public abstract class ShippingCalculator { public virtual void calculate() { /*implementation*/ } Ninguna 38. A developer creates a Lightning web component that imports a method within an Apex class. When a Validate button is pressed, the method runs to execute complex validations. In this implementation scenario, which artifact is part of the Controller according to the MVC architecture? XML file HTML file JavaScript file Apex class Ninguna 39. A Salesforce Administrator used Flow Builder to create a flow named "accountOnboarding". The flow must be used inside an Aura Component. Which tag should a developer use to display the flow in the component? lightning:flow aura-flow lightning-flow aura:flow Ninguna 40. 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? Use Test.loadData() and reference a CSV file in a static resource Use Anonymous Apex to create the required data Use SOQL to query the org for the required data Use Test.loadData() and reference a JSON file in Documents Ninguna 41. A developer creates a custom exception as shown below: public class ParityException extends Exception {} What are two ways the developer can fire the exception in Apex? Choose 2 answers throw new ParityException('parity does not match); throw new ParityException(); new ParityException('parity does not match'); new ParityException(); 42. 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? Exception Limits OrgLimits Messaging Ninguna 43. The Salesforce Administrator created a custom picklist field Account_status_c, on the Account object. This picklist has possible values of "Inactive" and "Active". As part of a new business process, management wants to ensure an opportunity record is created only for Accounts marked as Active. A developer is asked to implement this business requirement. Which automation tool should be used to fulfill the business need? Approval Process Workflow Rules Salesforce Flow Process Builder 44. Which annotation exposes an Apex class as a RESTful web service? @HttpInvocable @RestResource @RemoteAction @AuraEnabled Ninguna 45. What are two use cases for executing Anonymous Apex code? Choose 2 answers To schedule an Apex class to run periodically To add unit test code coverage to an org To run a batch Apex class to update all Contacts To delete 15,000 inactive Accounts ni a single transaction after a deployment 46. A developer has a 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? global inherited sharing class ProcessAccountProcessor implements Database.Batchable, Schedulable global inherited sharing class ProcessAccountProcessor implements Database.Batchable global inherited sharing class ProcessAccountProcessor implements Schedulable global inherited sharing class ProcessAccountProcessor implements Queueable Ninguna 47. A developer created a weather app that contains multiple Lightning web components. One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component. When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the Temperature component so the temperature can be converted and displayed. What is the recommended way to accomplish this? Use an application event to communicate between the components Create a custom event to handle the communication between components The Toggle component should call a method in the Temperature component Use Lightning Message Service to communicate between the components. Ninguna 48. 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? Add static to the server-side method signature Decorate the server-side method with (static=true) Decorate the server-side method with (static=false) Change the function signature to be private static Ninguna 49. Universal Containers is building a recruiting app with an Applicant object that stores information about an individual person and a Job object that represents a job. Each applicant may apply for more than one job. What should a developer implement to represent that an applicant has applied for a job? Lookup field from Applicant to Job Junction object between Applicant and Job Formula field on Applicant that references Job Master-detail field from Applicant to Job Ninguna 50. A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an OrderItem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders. What should a developer do to allow their code to move some existing OrderItem records to a new Order record? Add without sharing to the Apex class declaration Change the master-detail relationship to an external lookup relationship Create a junction object between OrderItem and Order Select the Allow reparenting option on the master-detail relationship Ninguna 51. Einstein Next Best Action is configured at Universal Containers to display recommendations to internal users on the Account detail page. If the recommendation is approved, a new opportunity record and task should be generated. If the recommendation is rejected, an Apex method must be executed to perform a callout to an external system. Which three factors should a developer keep in mind when implementing the Apex method? The method must be defined as static The method must use the @AuraEnabled annotation The method must use the @InvocableMethod annotation The method must be defined as public The method must use the @Future annotation 52. A business implemented a gamification plan to encourage its customers to watch some educational videos. Customers can watch videos over several days, and their progress is recorded. Award points are granted customers for all completed videos. When the video is marked as completed in Salesforce, an external webservice must be called so that points can be awarded to the user. A developer implemented these requirements in the after update trigger by making a call to an external web service. However, a Syetem,Cal1outException is occurring. What should the developer do to fix this error? Surround the external call with a try-catch block to handle the exception Move the callout to an asynchronous method with @future(callout=true) annotation Write a REST service to integrate with the external web service Replace the after update trigger with a before insert trigger Ninguna 53. static decimal DELIVERY_MULTIPLIER = 4.15; static final decimal DELIVERY_MULTIPLIER = 4.15; constant decimal DELIVERY_MULTIPLIER = 4.15; decimal DELIVERY_MULTIPLIER = 4.15; Ninguna 54. A developer is tasked with performing a complex validation using Apex as part of advanced business logic. When 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? public class PurchaseOrderException implements Exception() public class PurchaseOrder implements Exception() public class PurchaseOrderException extends Exception() public class PurchaseOrder extends Exception() Ninguna 55. AW Computing tracks order information in custom objects called Order__c and Order_Line__c. Currently, all shipping information is stored in the Order__c object. The company wants to expand its order application to support split shipments so that any number of Order_Line__c records on a single Order__c can be shipped to different locations. What should a developer add to fulfil this requirement? Order_Shipment_Group__c object and master-detail field on Order_Shipment_Group__c Order_Shipment_Group__c object and master-detail field on Order__c Order_Shipment_Group__c object and master-detail field on Order_Line__c Order_Shipment_Group__c object and master-detail fields to Order__c and Order_Line__c Ninguna 56. Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers. What should a developer change about the Visualforce page to help with the page load errors? Implement pagination with a StandardSetController Use lazy loading and a transient List variable Implement pagination with an OffsetController Use JavaScript remoting with SOQL Offset Ninguna 57. A developer completed modifications to a customized feature that is comprised of two elements: ●Apex trigger ●Trigger handler Apex class What are two factors that the developer must take into account to properly deploy the modification to the production environment? Choose 2 answers Test methods must be declared with the testMethod keyword At least one line of code must be executed for the Apex trigger All methods in the test classes must be @isTest Apex classes must have at least 75% code coverage org-wide 58. A software company uses the following objects and relationships: Case: to handle customer support issues Defect_c: a custom object to represent known issues with the company's software Case_effect_c: a junction object between Case and Defect_c to represent that a defect is a cause of a customer issue Case and Defect_c have Private organization-wide defaults. What should be done to share a specific case_Defect_c record with a user? Share the parent Defect__c record Share the parent Case and Defect__c records Share the parent Case record Share the Case_Defect__c record Ninguna Time's upTime is Up!