Platform Developer II Mock 10 27/01/2023 by Miquel Espinosa 0 Comments Welcome to your Platform Developer II Mock 10 1. Refer to re code segment above. When following best practices for writing Apex taggers, which two lots are wrong or cause for concern? Choose 2 answers Line 16 Line 20 Line 6 Line 11 2. During the Visualforce Page execution, what step follows immediately after "Evaluate constructors on controller and extensions"? Evaluate constructors, extensions, and expression on attribute definitions on any custom components present Evaluate expressions, attribute actions, and other method calls (getters/setters) on main page Create the view state Send HTML to Browser Ninguna 3. A company has a custom object Sales_Help_Request__c that has a Lookup relationship to Opportunity. The Sales_Help_Request__c has a number field, Number_of_Hours__c, that represents the amount of time spent on the Sales_Help_Request__c. A developer is tasked with creating a field, Total_Hours__c, on Opportunity that should be the sum of all of the Number_of_Hours__c values for the Sales_Help_Request__c records related to that Opportunity. What should the developer use to implement this? A trigger on the Opportunity object A trigger on Sales_Help_Request__c A roll-up summary field on the Opportunity object A workflow rule on the Sales_Help_Request__c object Ninguna 4. The maximum view state size of a visualforce page is______________. 256kb 165kb 1mb 135kb 65kb Ninguna 5. As part of their quoting and ordering process, a company needs to send PDFs to their document storage system's REST endpoint that supports OAuth 2.0. Each Salesforce user must be individually authenticated with the document storage system to send the PDF. What is the optimal way for a developer to implement the authentication to the REST endpoint? Named Credential with an OAuth Authentication Provider Hierarchy Custom Setting with an OAuth token custom field Hierarchy Custom Setting with a password custom field Named Credential with Password Authentication Ninguna 6. What are two benefits of using External IDs? Choose 2 answers An External ID is indexed and can improve the performance of SOQL queries. An External ID field can be used to reference a unique ID from another, external system. An External ID can be used with Salesforce Mobile to make external data visible. An External ID can be a formula field to help create a unique key from two fields in Salesforce. 7. A Visualforce page needs to make a callout to get biding information and tax information from two different REST endpoints. The information needs to be Displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process. How should a developer implement the callouts? A Continuation for the billing callout and an HTTP REST callout for the tax callout An HTTP REST call out for both the billing callout and the tax callout An HTTP REST callout for the billing callout and a Continuation for the tax callout A Continuation for both the billing callout and the tax callout Ninguna 8. What Salesforce tool lets you deploy/retrieve metadata, check status of apex jobs, and check responses of REST calls? Developer Console Streaming API Workbench Force.com Migration Tool Ninguna 9. A developer has a page with two extensions overriding the Standard controller for Case. What will happen when a user clicks the command button? All of the three Save methods will be executed Save from CaseExtensionOne will be executed Save from CaseExtensionTwo will be executed Save from Case Standard Controller will be executed Ninguna 10. A developer created a custom component to display an HTML table. The developer wants to be able to use the component on different Visualforce Pages and specify different header text for the table. Which tag should the developer use inside the component? apex:param apex:variable apex:attribute apex:define Ninguna 11. An org contains two custom objects; Building__c and Office__c. Office__c has a Lookup field to Building__c. A developer is asked to automatically populate the Number_of_Offices__c field on the Building__c object with the count of related Office__c records anytime an Office__c record s created or deleted. The developer cannot modify the field types. Which solution meets the requirements? Process Builder Workflow Apex Trigger Flow Ninguna 12. If a developer wanted to display error messages with the standard Salesforce Ul styling, what would they use? apex:outputText apex:pageMessages apex:error apex:message Ninguna 13. An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved. What is the optimal way to implement this? Apex trigger on Account that and Account that normalized the address Apex trigger on Account that calls the Contact trigger to normalize the address Apex trigger on Account and Account that call a helper class to normalize the address Apex trigger on Contact that calls the Account trigger to normalize the address Ninguna 14. A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process. During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll, back to SP3 is called, a runtime error occurs. Why does the developer receive a runtime error? SP3 became invalid when SP1 was rolled back. The developer used too many savepoints in one trigger session. The developer has too many DML statements between the savepoints. The developer should have called SP2 before calling SP3. Ninguna 15. Consider the code above. When a user clicks on the Link of a Contact's name, what happens? The outputPanel refreshes, showing the Contacts details. Nothing happens: the commandLink is missing an action attribute. The page refreshes, showing the Contact's details. A new page opens, showing the Contact's details. Ninguna 16. if the "PageReference.setRedirect" Apex function is set to False, what type of request is made? If PageReference points to the same controller and subset of extensions, postback request, otherwise get request Postback request Get request Ninguna 17. The Salesforce instance at Universal Containers currently integrates with a third-party company to validate mailing addresses via REST services. The third-party address verification system recently changed endpoint URLs for all their set vices from https://th-addreaa-service.3pc.com to https://plc1-mailsarvice.3pc.com. Everything else remained the same. The developer updated code to reflect this endpoint change, but the mailing address validation service stopped working after the change. What else should be done to complete this web service end point change? Test the callout property using HttpCalloutMock. Add web service IP Addresses to Trusted IP Ranges m the Network Access security controls settings. Use a Custom Setting with the new endpoint Instead of hard coding the URL. Create a new Remote Site for the new endpoint URL. Ninguna 18. A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this? Create an Apex trigger and make a callout to the OMS from the trigger. Create an Outbound Message that contains the session ID and send it to the OMS. Generate the Enterprise WSDL and use it to make a callout to the OMS. Generate the Partner WSDL and use it to make a callout to the OMS. Ninguna 19. A Visualforce page contains an industry select list and displays a table of Accounts that have a matching value in their Industry field. When a user changes the value in the industry select list, the table of Accounts should be automatically updated to show the Accounts associated with the selected industry. What is the optimal way to implement this? Add an apex: actionFunction within the apex : selectOptions. Add an apex: actionSupport within the apex: selectOptions. Add an apex: actionSupport within the apex:selectList. Add an apex: actionFunction within the apex: select List . Ninguna 20. lightning:layout multipleRows="true" lightning:layoutItem size="12"{!v.account.Name} /lightning:layoutItem lightning:layoutItem size="12"{!v.account.AccountNumber} /lightning:layoutItem lightning:layoutItem size="12"{!v.account.Industry} /lightning:layoutItem /lightning:layout Refer to the component code above. The information displays as expected (in three rows) on a mobile device. However, the information is not displaying as desired (in a single row) on a desktop or tablet. Which option has the correct component changes to display correctly on desktops and tablets? A. lightning:layout multipleRows="true" lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4"{!v.account.Name} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4"{!v.account.AccountNumber} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="6" largeDeviceSize="4"{!v.account.Industry} /lightning:layoutItem /lightning:layout B. lightning:layout multipleRows="true" lightning:layoutItem size="12" largeDeviceSize="4"{!v.account.Name} /lightning:layoutItem lightning:layoutItem size="12" largeDeviceSize="4"{!v.account.AccountNumber} /lightning:layoutItem lightning:layoutItem size="12" largeDeviceSize="4"{!v.account.Industry} /lightning:layoutItem /lightning:layout C. lightning:layout multipleRows="true" lightning:layoutItem size="12" mediumDeviceSize="4"{!v.account.Name} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="4"{!v.account.AccountNumber} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="4"{!v.account.Industry} /lightning:layoutItem /lightning:layout D. lightning:layout multipleRows="true" lightning:layoutItem size="12" mediumDeviceSize="6"{!v.account.Name} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="6"{!v.account.AccountNumber} /lightning:layoutItem lightning:layoutItem size="12" mediumDeviceSize="6"{!v.account.Industry} /lightning:layoutItem /lightning:layout Ninguna 21. Which technique can run logic when an Aura Component is loaded? Use the connectedCallback(0 method. Use the standard doinit function in the controller. Use an aura:handler 'init'' event to call a function. Call $A. enqueueAction passing in the method to call. Ninguna 22. An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state. Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts. What will happen when the mass update occurs? The mass update of Account address will succeed, but the Contact address updates will fail due to exceeding number of records processed by DML statements. There will be no error, since the limit on the number of records processed by DML statements is 50,000. The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML statements. There will be no error, since each trigger fires within its own context and each trigger does not exceed the limit of the number of records processed by DML| statements. Ninguna 23. A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order's shipping address is not numeric. What is a recommended way for the error message be displayed to the end user? Use the ui:inputDefaultError tag to display errors Use the apex:message tag to display errors Use the aura:component tag to display errors Use the uhoutputText tag to display errors Ninguna 24. A developer must create a custom pagination solution. While users navigate through pages, if the data is changed from elsewhere, users should still see the cached results first accessed. How can the developer meet these requirements? Use OFFSET WITH CACHE in SOQL queries Use @Cache annotation Use OFFSET in SOQL queries Use a StandardSetController Ninguna 25. A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet: Caura: component implements-"forcethaaRecordid, flexipage:availableForAllPageTypes"> Hello! How can the component's controller get the context of the Lightning page that the sobject is an without requiring additional best coverage? Add force:hasSobjectName to the implements attribute Create a design attribute and configure via App Builder Set the object type as a component attribute. Use the getSObjectType () method in an Apex class Ninguna 26. Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__c. Which two queries are optimized for large data volumes? Choose 2 answers SELECT Id FROM Account WHERE Name != ' ' AND Customer Number c = 'ValueA' SELECT Id FROM Account WHERE Name != NULL SELECT Id FROM Account WHERE Name != ' ' AND IsDeleted = false SELECT Id FROM Account WHERE Id IN : aListVariable 27. What is the transaction limit on the number of "sendEmail" method calls? 20 10 50 100 There is no limit Ninguna 28. Universal Containers stores user preferences in a Hierarchy Custom Setting, User_prefs_c, with a Checkbox field, show_Help_c, Company-Level defaults are stored at the organizational level, but may be overridden at the user level, If a user has not overridden preferences, then the defaults should be used. How should the Show_Help_c preference be retrieved for the current user? Boolean show = User prefs_c, Show_Help_c; Boolean show = User_Prefs_c, getinstance( ), Show_Help _c; Boolean show = User_Prefs_c, getvaluesUserInfo.getUserid() ).Show_Help_c; Boolean show = User_Prefs_c, getValues ( ). Show _Help_c; Ninguna 29. The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Account are simultaneously updated to be customer. The test method fails at the Line 20 because of too many SOQL queries What is the correct way to fix this? The test method above tests an Apex trigger that the developer knows will make a lot of queries when a lot of Accounts are simultaneously updated to be customers. The test method fails at the Line 20 because of too many SOQL queries. What is the correct way to fix this? Add TeststartTest() before Line 18 of the code and add Test.stopTest() after line 18 of the code. Replace most of the Apex Trigger with Process Builder processes to reduce the number of queries in the trigger. Change the DataFactory class to create fewer Accounts so that the number of queries in the trigger is reduced. Add TesLstartTest() before and Test.stop Test() after both Line 7 of the code and Line 20 of the code. Ninguna 30. The use of the transient keyword In Visualforce Page Controllers helps with which common performance issued? Improves Page Transfers Reduces Load Times Improves Query Performance Reduces View State Ninguna 31. A developer wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is dosed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion? The test class has not re-queried the Account record after updating the Opportunity. The test class is not using System.runAs() to run tests as a Salesforce administrator. The test class has not defined an Account owner when inserting the test data. The test class has not implemented seeAIIData-truwh the test method. Ninguna 32. A large company uses Salesforce across several departments. Each department has its own Salesforce Administrator. It was agreed that each Administrator would have their own sandbox in which to test changes. Recently, users notice that fields that were recently added for one department suddenly disappear without warning. Also, Workflows that once sent emails and created tasks no longer do so. Which two statements are true regarding these issues and resolution? Choose 2 answers The administrators are deploying their own Change Sets over each other, thus replacing entire Page Layouts and Workflows in Production A sandbox should be created to use as a unified testing environment instead of deploying Change Sets directly to production. The administrators are deploying their own Change Sets, thus deleting each other's fields from the objects in production. Page Layouts should never be deployed via Change Sets, as this causes Workflows and Field- level Security to be reset and fields to disappear. 33. Universal Containers needs to integrate with a Heroku service that resizes product images submitted by users. What are two alternatives to implement the integration and protect against malicious calls to Heroku app's endpoint? Choose 2 answers Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data; therefore the Heroku app can automatically reply back to the callout with the resized images in Salesforce. Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in Salesforce. Create a Workflow Rule with an Outbound Message and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce. Create a trigger that uses an @future Apex HTTP callout passing JSON serialized data and some form of pre-shared secret key. so that the Heroku app can authenticate requests and store the resized images in Salesforce. 34. How can the DISTANCE and GEOLOCATION functions be used i|n SOQL queries? (Choose two.) To order results by distance from a latitude or longitude To get the distance results from a latitude and longitude To filter results based on distance from a latitude and longitude To group results in distance ranges from a latitude and longitude 35. A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits. What are three recommendations to optimize page performance? (Choose three.) Use JavaScript Remoting instead of controller actions Implement pagination and reduce records per page Segregate calculation functionality from input functionality Specify the list of sales forecasts as transient Create formula fields to compute pivoted forecast calculations 36. When testing batch classes, what must a developer do? (Choose two.) Use seeAIIData=true Encapsulate code in Test.startTestQ and Test.stopTestQ Call the class* "execute" method Limit the amount of records you test to < 200 37. What are three benefits of using declarative customizations over code? Choose 3 answers Declarative customizations will automatically update with each Salesforce release. Declarative customizations are not subject to governor limits. Declarative customizations cannot generate run time errors. Declarative customizations generally require less maintenance. Declarative customizations do not require user testing. 38. What is a potential design issue with the following code? The code will result in a System.LimitException: Apex CPU time limit exceeded error The code will result in a System.DmException:Entity_is_Deleted error The code will result in a System.LimitException : Too many script statements error Ninguna 39. A company's support process dictates that any time a Case is closed with a Status of 'Could not fix,' an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case. What is the correct way to automate this using an Apex trigger? A before update trigger that creates the Engineering Review record and inserts it An after upsert trigger that creates the Engineering Review record and inserts it An after update trigger that creates the Engineering Review record and inserts it Ninguna Time's upTime is Up!