Platform Developer II Mock 3 25/01/2023 by Miquel Espinosa 0 Comments Welcome to your Platform Developer II Mock 3 1. Which two queries are selective SOQL queries and can be used for a large data set of 200,000 Account records? Choose 2 answers SELECT id FROM ACCOUNT WHERE Name = Null AND Customer_Number_c= 'ValueA' SELECT id FROM ACCOUNT WHERE id IN (list of Account Ids) SELECT id FROM ACCOUNT WHERE Name = Null SELECT id FROM ACCOUNT WHERE Name = !: ' ' 2. 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.getValues(UserInfo.getUserId()).Show_Help__c; Boolean show = User_Prefs__c.getInstance().Show_Help__c; Boolean show = User_Prefs__c.Show_Help__c; Boolean show = User_Prefs__c.getValues().Show_Help__c; Ninguna 3. A developer Is asked to develop a new AppExthange application. A feature of the program creates Survey records when a Case reaches a certain stage and Is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to most customers. What should the developer use to store and package the custom configuration settings for the app? Custom Settings Custom Objects Process Builder Custom Metadata Ninguna 4. Where in a query can you use Geolocation and Distance? Order By clause Filter clause Select clause Group By clause 5. Which of the following elements can be members of a public group? (Choose three.) Users Profiles Roles Territories Case Teams 6. What is the transaction limit for the number of records using QueryLocator? 50,000 50,000,000 100,000 5,000,000 There is no limit Ninguna 7. What is the transaction limit for the number of records for SOQL queries? 10,000 20,000 50,000 5,000 There is no limit Ninguna 8. Refer to re code segment above. When following best practices for writing Apex taggers, which two lots are wrong or cause for concern? Line 16 Line 11 Line 6 Line 20 9. Users report that a button on a custom Lightning Web Component is not working. However, there are no other details provided. What should the developer use to ensure error messages are properly displayed? Add JavaScript and HTML to display an error message. Add a Try/Catch block surrounding the DML statement. Use the Database method with allOrNone set to false. Add the tag to the component. Ninguna 10. Consider the above trigger intended to assign the Account to the manager of the Account''s region. Which two changes should a developer make in this trigger to adhere to best practices? Choose 2 answers Move the Region__c query to outside the loop. Use a Map accountMap instead of List accountList. Use a Map to cache the results of the Region__c query by Id. Remove the last line updating accountList as it is not needed. 11. Universal Containers uses a custom Lightning page to provide a mechanism to perform a step- by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERP_Number__c, that is then used in a query to find matching Accounts. A developer receives the exception 'SOQL query not selective enough. Which step should be taken to resolve the issue? Mark the lRP_Number__c field as an external ID. Mark the ERP_Number__c field as required. Perform the SOQL query as part of a for loop. Move the SOQL query to within an asyncronous process. Ninguna 12. 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 the Heroku app's endpoint? Choose 2 answers 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. 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 re images back to Salesforce. 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. 13. A developer writes the following code: While testing the code, the developer receives the following error message: System.CalloutException : You have uncommitted work pending What should the developer do? (Choose two.) Move the web service callout into an @future method Use Database.insert (order, true) to immediately commit any database changes Ensure all callouts are completed prior to executing DML statements Use the asyncSend() method of the HTTP class to send the request in async context 14. What is the optimal technique a developer should use to programmatically retrieve Global Picklist options in a Test Method? Use the Schema namespace. Perform a callout to the Metadata API. Use a static resource performs a SOQL Query. Ninguna 15. Salesforce users consistently receive a "Maximum trigger depth exceeded" error when saving m Account. How can a developer fix this error? Modify the trigger to use the isMultiThread=true annotation. Use a helper class to set a Boolean to TRUE the first time a trigger is fired, and then; modify the trigger to only fire when modify the trigger to only fire when the Boolean is FALSE. Split the trigger logic into two separate triggers. Convert trigger to use the future annotation, and chain any subsequent trigger invocations to the Account object. Ninguna 16. A developer is building a Lightning web component that displays quantity, unit price, and the total for an order line item. The total is calculated dynamically as the quantity multiplied by the unit price. What must be added to display the total? Add calculate Total() {return quantity * unitPrice;} to the javaScript and Total : {calculate Total()} in the template. Add Total: {quantity * UnitPrice} in the template. Add get total() { return quantity * unitPrice;} to the JavaScript and Total: {total} in the template. Add Total; {multiple quantit,y unitprice)} in the template. Ninguna 17. What is the output of the following code snippet? l Contact con = new Contact( LastName = 'Smith', Department = 'Admin'); 2 insert con; 3 4 Savepoint sp_finance = Database.setSavepoint(); 5 con.Department 'finance'; 6 update con; 7 8 Savepoint sp_hr = Database.setSavepoint(); 9 con.Department = 'HR'; 10 update con; 11 12 Database.rollback(sp_finance); l3 Database.rollback(sp_hr); The contact record will be saved with department value Finance. A runtime error will be thrown on line 13. A runtime error will be thrown on line 12. The contact record will be saved ME department value HR. Ninguna 18. Which use case is an appropriate fit for the ©future asynchronous Apex method? (Choose two.) A developer has jobs that need larger query results than regular transactions allow A developer needs to segregate DML operations and bypass the mixed save DML error A developer has long-running methods and needs to prevent delaying an Apex transaction A developer has long-running jobs with large data volumes that need to be performed in batches 19. What are three benefits of using declarative customizations over code? (Choose three.) Declarative customizations generally require less maintenance. Declarative customizations will automatically update with each Salesforce release. Declarative customizations do not require user testing. Declarative customizations are not subject to governor limits. Declarative customizations cannot generate run time errors. 20. A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen. Which functionality consideration impacts the final decision? Will the screen make use of a JavaScript framework? Does the screen need to be accessible from the Lightning Experience UI? Will the screen be accessed via a mobile app? Does the screen need to be rendered as a PDF? Ninguna 21. The maximum view state size of a visualforce page is __________. 135kb 65kb 165kb 256kb 1mb Ninguna 22. A developer has generated Apex code from a WSDL for an external web service. The web service requires Basic authentication. What code should the developer use to authenticate? stub.authentication.put ('Authorization','Basic QthZGprjpchVulHNchFtZQ') Http.setAuthentication('Basic QthZGprjpchVulHNchFtZQ') Http.setHeader ('Authorization' , 'Basic QthZGprjpchVulHNchFtZQ!) stub.inputHttpHeaders_x.put('Authorization' , 'Basic QthZGprJpchVulHNchFtZQ') Ninguna 23. Code must have X% overall code coverage. X = 100 X = 75 X = 65 X = 50 Ninguna 24. A developer must perform a complex SOQL query that joins two objects in a Lightning component. how can the Lightning component execute the query? Invoke an Apex class with the method annotated as ©AiraEnabled to perform the query. Create a Process Builder to execute the query and invoke from the Lightning component. Write the query in a custom Lightning web component wrapper and invoke from the Lightning component. Use the SaJesforce Streaming API to perform the SOQL query. Ninguna 25. Choose the correct definition for Allows for controller methods to be called directly from Javascript. Must be encapsulated in tags. Unlike actionSupport, these functions can be called directly from Javascript code Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.) Sends an AJAX request according to the time interval you specify. If this ever gets re- rendered, it resets Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and shows content conditionally depending on the status of the request (in progress/complete). Use the "id" field to specify name; use "status" field on related components to connect them Signifies which components should be processed by the server when an AJAX request is generated Ninguna 26. Which two relationship queries use the proper syntax? Choose 2 answers SELECT Name, (SELECT LastName FROM Contacts) FROM Account SELECT Name, (SELECT LastName FROM Contacts__r) FROM Account SELECT Id, Name, Account __r.Name FROM Contact WHERE Account r.Industry = 'Media' SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Media' 27. There are user complaints about slow render times of a custom data table within a visualforce page that loads thousands of Account records at once. What can a developer do to help alleviate such issues? Upload a third-party data table library as a static resource. Use the transient keyword in the Apex code when querying the Account records. Use JavaScript remoting to query the accounts. Use the standard Account List controller and implement pagination. Ninguna 28. When calling a RESTful web service, a developer receives a JSON payload that has a data hierarchy that is nested three levels deep. How can the developer describe the external data? Declare a class with three levels and deserialize the JSON typed with this class. Deserialize the data untyped and then process it. Use the ANT migration tool, the custom metadata API, or the Dataloader. Use middleware to flatten the JSON and consume it as a new custom object. Ninguna 29. Ninguna 30. Sales representatives at UC should be restricted to view Cases associated with Accounts in their territory. UC's data model sharing for Accounts is private and an administrator owns all the Accounts in the UC org. Set sharing for Cases to 'Private'. In the Territory Model, set Case Access to 'View'. Create a sharing set to share Cases with internal sales representatives. Add sales representatives to the Account Team for Accounts, with 'Read Only' access to Cases. 31. 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 32. A developer migrated functionality from JavaScript demoting to a Lightning web component and wants to use the existing getOpportunities() method to provide data. Which modification to the method is necessary? The method must return a JSON Object. The method must be decorated with AuraEnabled. The method must return a String of a serialized JSON Array. The method must be decorated with (cacheable=true). Ninguna 33. 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 uhoutputText tag to display errors Use the uhinputDefaultError tag to display errors Use the apex:message tag to display errors Use the aura:component tag to display errors Ninguna 34. When a user clicks on the Link of a Contact's name, what happens' The outputPanel refreshes, showing the Contacts details. A new page opens, showing the Contact's details. The page refreshes, showing the Contact's details. Nothing happens: the commandLink is missing an action attribute. Ninguna 35. The Metadata API___________. Is used to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment Is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, queryAII, insert, update, upsert, or delete many records asynchronously by submitting batches Provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it's an excellent choice of technology for use with mobile applications and web projects Is used to create, retrieve, update or delete records, such as accounts, leads, and custom objects, and allows you to maintain passwords, perform searches, and much more Ninguna 36. Ninguna 37. The head of recruiting at Universal Containers wants to provide all internal users the ability to search for open positions by role, department, and location via a new recruiting app, In addition to search, users of the app should be able to refer a fried, apply for a position, and review the status of their current submissions. The app should be made available in Salesforce Mobile, but offline access is not required. Given these requirements, what is the recommended approach to developer the app? Lightning Experience Builder Salesforce SDK Visualforce Lightning Web Components Ninguna 38. The SOAP API... Is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, queryAll, insert, update, upsert, or delete many records asynchronously by submitting batches Is used to to create, retrieve, update or delete records, such as accounts, leads, and custom objects, and allows you to allows you to maintain passwords, perform searches, and much more Provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it's an excellent choice of technology for use with mobile applications and web projects Is used to to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment Ninguna 39. A developer receives the exception 'SOQL query not selective enough' when performing a query on an object with a large amount of dat a. Which step should be taken to resolve the issue? Perform the SOQL query via a call to the REST API. Move the SOQL query to within an asynchronous process. Use an ID in the WHERE clause of the SOQL query. Perform the SOQL query as part of a FOR loop. Ninguna 40. A company requires an external system to be notified whenever an account is updated. What LimitException could the following code trigger? System.LimitException: Too many callouts System.CalloutException: Callout from triggers are currently not supported System.LimitException: Too many future calls System.LimitException: Too many SOQL queries Ninguna 41. A developer wrote an Apex class to make several callouts to an external system. If the URLs used in these callouts will change often, which feature should the developer use to minimize changes needed to the Apex class? Remote Site Settings Session Id Named Credentials Named Credentials Ninguna 42. In an organization that has multi-currency enabled, a developer is tasked with building a Lighting Component that displays the top ten Opportunities most recently access by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale. What is the most effective approach to ensure values displayed respect the users locale settings? Use the FORMAT() function in the SOQL query. Use the FOR VIEW clause in the SOQL Query. Use a wrapper class to format the values retrieved via SOQL. Use REGEX expressions to format the values retrieved via SOQL. Ninguna 43. A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production. What should the developer ensure to correct these errors? Ensure profiles have access to the Visualforce page. Ensure properties are marked as private. Ensure queries do not exceed governor limits. Ensure properties are marked as Transient. Ninguna 44. Recently a Salesforce org's integration failed because it exceeded the number of allowed API calls in a 24-hour period. The integration handles a near real-time, complex insertion of data into Salesforce. The flow of data is as follows: The integration looks up Contact records with a given email address and, if found, the integration adds a Task to the first matching Contact it finds. If a match is not found, the integration looks up Lead records with a given email address and, if found, the integration adds a Task to the first matching Lead it finds. If a match is not found, the integration will create a Lead and a Task for that newly created Lead. What is one way in which the integration can stay near real-time, but not exceed the number of allowed API calls in a 24- hour period? Create several Apex InboundEmailHandlers to accept calls from the third-party system, thus bypassing the API limits. write a custom Apex web service that, given an email address, does all of the logic the integration code was doing. Use the REST API as well as the SOAP API to effectively double the API calls allowed in a 24- hour period. Create an Inbound Message that, using Flow, can do all of the logic the integration code was doing. Ninguna 45. A developer has requirement to query three fields (id, name, Type) from an Account and first and last names for all Contacts associated with the Account. Which option is the preferred optimized method to achieve this for the Account named 'Ozene Electronics'? Account a = (SELECT ID, Name, Type, (select contat,firstName, Contact,LastName from Account, Contacts) from Account where name; Ozone Electronic' Limit 1 ); Account, Contacts) from Account where name; Ozone Electronic' Limit 1 ); B. List 1Contacts = new list ( ); for(Contact c ; 1Select firstname, lastname Account, Name Account,ID Account, Type from Contact where Account: Name=' electronics')) ( iContacts.add(c);) Account a = (SELECT ID, Name, Type from Account where name= Ozone Electronics;) list 1contacts = (SELECT firstname, lastname from Contacts where accountid=: a -ID0; List 1Accounts = (Select ID, Name, Type from Account Join (Select ID, firstname, lastname form Contact where contact account , name 'ozone electronics)); Ninguna 46. An org has a custom object, Registeration_c that has a lookup relationship to the Opportunity object. What should a developer use to create a stand-alone Vlsualforce page that displays the Registration__c records related to an Opportunity. A standard controller with a controller extension A custom controler A standard controller A controler extension Ninguna 47. Which statement is true about using ConnectApi namespace (also called Chatter in Apex)? (Choose two.) Chatter in Apex operations are synchronous, and they occur immediately Chatter in Apex methods honor the 'with sharing' and 'without sharing' keywords Many test methods related to Chatter in Apex require the IsTest (SeeAIIData=true) annotation Chatter in Apex methods do not run in system mode; they run in the context of the current user 48. 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 SOQL could be avoided by creating a formula field for StageName in Account from the related Opportunity The code will result in a System.LimitException : Too many script statements error Ninguna 49. What is the correct syntax for calling a controller action from a Visualforce page and updating part of the page once the action is completed? Choose 2 answers apex:commandFunction action="{!Save}" value="Save" rendered="thePageBlock"/ apex:actionFunction action="{!Save}" name="Save" rerender="thePageBlock"/ apex:commandButton action="{!Save}" value="Save" redraw="thePageBlock"/ apex:actionSupport action="{!Save} " event="onchange" rerender="thePageBlock"/ 50. A developer has built a multi-page wizard using a single Custom Controller to query and update data. Users are complaining that the pages are loading slowly. What will improve performance? Choose 3 answers Setting the Apex Page attribute cache=true. Using selective queries. Using actionRegion and rerender. Reducing the view state. Turning off the standard stylesheet. 51. A company represents their customers as Accounts in Salesforce. All customers have a unique Customer_Number__c that is unique across all of the company's systems. They also have a custom Invoice__c object, with a Lookup to Account, to represent invoices that are sent out from their external system. This company wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer is paying their bills on time. What is the optimal way to implement this? Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly. Ensure Customer_Number__c is an External ID and that a custom field Invoice_Number__c is an External ID and Upsert invoice data nightly. Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice. Ninguna 52. Which of the following exceptions cannot be caught and will force an error? (Choose 3) ListException DMLException License exceptions AssertException SObjectExceptions LimitException 53. 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? 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. Create an Outbound Message that contains the session ID and send it to the OMS. Create an Apex trigger and make a callout to the OMS from the trigger. Ninguna 54. An org has a requirement that the Shipping Address on the Account must be validated by a third- party web service, before the Account is allowed to be inserted. What is the optimal way to meet this requirement? Make a callout to the web service from an after insert trigger. Make a callout to the web service from a before insert trigger. Make a callout to the web service from a custom Visualforce controller. Make a callout to the web service from a standard Visualforce controller. Ninguna 55. A developer wants to integrate invoice and invoice line data into Salesforce from a custom billing system. The developer decides to make realtime callouts from the billing system using the SOAP API. Unfortunately, the developer is getting a lot of errors when inserting the invoice line data because the invoice header record doesn't exist yet. What will help ensure ne transactional Integrity of the integration? Develop a custom Apex web service to handle a custom JSON data structure with both invoice header and related invoice lines. Use an ETL tool and the Bulk API running nightly, thus ensuring all of the data is handled at the same time. Set the AIIOrNoneHeader to true when calling each of create() for invoice headers and create() for invoice lines. Create the invoice header and the related invoice lines in the same create() call leveraging External Ids. Ninguna 56. A company has a custom object, Sales Demo Request, that has a lookup to an Opportunity. It is required that a Sales Demo Request record be created when an Opportunity's Probability is greater than 50%. What is the optimal way to automate this? Use an Apex Trigger on Opportunity. Build a Process on Opportunity Create a Workflow on Opportunity. Build a Flow on Opportunity. Ninguna 57. A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a Custom Object called Survey_Response_ _c do not belong to a list of blocked domains. The list of blocked domains will be stored in a custom object for ease of maintenance by users. Note that the Survey_Response_ _c object is populated via a custom Visualforce page. What is the optimal way to implement this? Implement the logic in an Apex trigger on Contact and also implement the logic within the Custom Visualforce page controller Implement the logic in a Validation Rule on the Contact and a Validation Rule on the Survey_Response_ _c object Implement the logic in a helper class that is called by an Apex trigger on Contact and from the Custom Visualforce page controller Implement the logic in the Custom Visualforce page controller and call that method from an Apex trigger on Contact Ninguna 58. A developer has created a Team Member sObject that has a Master-Detail relationship to a Project sObject and a Lookup relationship to the User sObject. The developer must ensure that a User listed on a Team Member record has Read-Write access to the parent Project record. How can the developer accomplish this if the Project sObject has a Private sharing model and thousands of Project records? Create a Project Sharing Rule that shares to the Team Member Group Create a Controller that uses the Without Sharing keyword. Create a Team Member Trigger that inserts Project_Share records. Create a Criteria-Based Sharing Rule on the Project sObject. Ninguna 59. A developer is writing unit tests for the following method: Which assertion would be used in a negative test case? System.assertEquals (true, isFreezing('O') System.assertEquals(true, isFreezingClOO')) System.assertEquals(true, isFreezing(null)) System.assertEquals(null, isFreezing('asdf)) Ninguna 60. 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? Segregate calculation functionality from input functionality. Specify the list of sales forecasts as transient. Use JavaScript Remoting instead of controller actions. Implement pagination and reduce records per page. Create formula fields to compute pivoted forecast calculations. 61. 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 and select Send Session ID so that the Heroku app can use it to send the resized images back to Salesforce. Create a Workflow Rule with an Outbound Message allowing the Heroku app to automatically store the resized images in 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. 62. 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 update trigger that creates the Engineering Review record and inserts it 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 Ninguna Time's upTime is Up!