Platform Developer II Mock 2 25/01/2023 by Miquel Espinosa 0 Comments Welcome to your Platform Developer II Mock 2 1. What is the transaction limit for the number of records for SOSL? There is no limit 20 200 (synchronous), 100 (async) 2,000 100 (synchronous), 200 (async) Ninguna 2. How can Apex be used with Visual Workflow? To start a Flow automatically To set the version of a Flow being run To add custom styling to a Flow To control access to a Flow Ninguna 3. Which two objects can be inserted in the same transaction? (Choose two.) Case and CaseComment Account and AccountShare Opportunity and User Account and Group 4. 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? Hierarchy Custom Setting with an OAuth token custom field Hierarchy Custom Setting with a password custom field Named Credential with an OAuth Authentication Provider Named Credential with Password Authentication Ninguna 5. Which of the following exceptions cannot be caught and will force an error? (Choose three.) LimitException AssertException SObjectExceptions DMLException License exceptions ListException 6. 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? An after update trigger that creates the Engineering Review record and inserts it An after upsert trigger that creates the Engineering Review record and inserts it A before update trigger that creates the Engineering Review record and inserts it Ninguna 7. look at pic A Custom Report Type and a report Lightning Component on the Community Home Page A Custom List View on the junction object with filters that will show the proper records based on owner A Visualforce page that uses a Custom Controller that specifies without sharing to expose the records An Apex Trigger that creates Apex Managed Sharing records based on the junction object's relationships Ninguna 8. A developer wants to create a Visualforce page that allows a user to search for a given account by Name. If the account is found, the account details should be populated on screen. If no account is found, an error message should be displayed to the user. How can this be accomplished? (Choose two.) Use the tag to display the error message Use the ApexPages.addMessage() method to add the error message Use the accountaddErrorQ method to add the error message Use the (apex: information) tag to display the error message 9. 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 Objects Process Builder Custom Metadata Custom Settings Ninguna 10. [FIND 'map' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead] What is a valid return type for th|e following SOSL query? List> List Ninguna 11. What is the transaction limit for the number of records per DML statement? 50,000 10,000 20,000 5,000 There is no limit Ninguna 12. What is a recommended practice with regard to the Apex CPU limit? (Choose two.) Reduce view state in Visualforce pages Use Map collections to cache sObjects Avoid nested Apex iterations Optimize SOQL query performance 13. 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 Name = !: ' ' SELECT id FROM ACCOUNT WHERE id IN (list of Account Ids) SELECT id FROM ACCOUNT WHERE Name = Null 14. 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 20 Line 11 Line 16 Line 6 15. After a Platform Event Is defined in a Salesforce org, events can be published via which two mechanisms? Choose 2 answers External Apps use an API to publish event messages Internal Apps can use Outbound Messages. Internal Apps can use Process Builder. External Apps require the standard Streaming API 16. What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test? ApexPages.StandardController sc = new ApexPages.StandardController(acct.id); AccountControllerExt extension = new AccountControllerExt (sc); AccountControllerExt extension = new AccountControllerExt(acct); ApexPages.StandardController sc = new ApexPages.StandardController(acct); AccountControllerExt extension = new AccountControllerExt(sc); AccountControllerExt extension = new AccountControllerExt(acct.Id); Ninguna 17. A company accepts orders for customers in their enterprise resource planning (ERP) crder__c records with a lookup field to Account. The Account object has an External ID field, ERP_Customer_ID__c. What should the integration use to create new Order__c records that will automatically be related to the correct Account? Insert on the Order__c object followed by an update on the Order__c object. Upsert on the Account and specify the ERP_Customer_ID__c. Merge on the Order__c object and specify the ERP_Customer_ID__c. Upsert on the Order__c object and specify the ERP_Customer_ID__c. Ninguna 18. A developer created a JavaScript function as a part of a Lightning web component (LWC) that surfaces information... about leads by imperatively calling getFetchLeadList when certain criteria are met. What are these changes the developer should implement in the Apex class above to ensure the LWC can displ... data efficiently while preserving security? Choose 3 answers Implement the without sharing keyword in the class declaration. Implement the with sharing keyword in the class declaration. Annotate the Apex method with 8AuraEnabled (Cacheable-true). Use the WITH SECURITY_ENFORCED clause within the SOQL query. Annotate the Apex method with gAuraEnabled- 19. A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow. What can a developer to do address the issue? Move the prerequisite reference data setup to a static method in the test class and call that from each test method. Move the prerequisite reference data setup to the constructor for the test class. Move the prerequisite reference data setup to a TestDataFactory and call that from each test method. Move the prerequisite reference data setup to a @testSetup method in the test class. Ninguna 20. During the Visualforce Page execution, what step follows immediately after "Evaluate constructors on controller and extensions"? Create the view state Evaluate constructors, extensions, and expression on attribute definitions on any custom components present Send HTML to Browser Evaluate expressions, attribute actions, and other method calls (getters/setters) on main page Ninguna 21. Universal Containers (UC) wants to develop a customer community to help their customers log issues with their containers. The community needs to function for their German- and Spanish- speaking customers also. UC heard that it's easy to create an international community using Salesforce, and hired a developer to build out the site. What should the developer use to ensure the site is multilingual? Use Custom Objects to translate custom picklist values. Use Custom Settings to ensure custom messages are translated properly. Use Custom Labels to ensure custom messages are translated property. Use Custom Metadata to translate custom picklist values. Ninguna 22. 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 properties are marked as Transient. Ensure properties are marked as private. Ensure queries do not exceed governor limits. Ensure profiles have access to the Visualforce page. Ninguna 23. Which of the following elements can be part of a public group? (Choose three.) Roles Profiles Territories Case Teams Users 24. 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? Named Credentials Remote Site Settings Connected Apps Session Id Ninguna 25. What is a best practice when unit testing a controller? (Choose two.) Simulate user interaction by leveraging Test.setMock() Set query parameters by using getParameters().put Verify correct references by using getURL() Access test data by using seeAIIData=true 26. What is the transaction limit for the number of records for SOQL queries? 20,000 50,000 10,000 5,000 There is no limit Ninguna 27. A developer needs to send Account records to an external system for backup purposes. The process must take a snapshot of Accounts as they are saved and then make a callout to a RESTful web service. The web service can only receive, at most, one record per call. Which feature should be used to implement these requirements? Process Builder Queueable @future workflow Ninguna 28. A developer is creating a LWC that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating. What should the developer change in the code above for this to happen? Call refreshApex() on this.data Add the @track decorator to the data variable Create a new variable to store the result and annotate it with @track Create a variable to store the result and call refreshApex() Ninguna 29. A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as part of the unit tests setup. What are three actions to enable this functionality? (Choose three.) Surround the data insertion with Test.startTest(), Test.stopTest() Surround the callout with TeststartTest(), Test.stopTest() Implement the WebServiceMock interface Update code to call Test.setMock() Implement the HttpCalloutMock interface 30. 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 31. A developer created a JavaScript library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource called jsutils in Salesforce. Another developer is coding a new Lightning web component (LWC) and wants to leverage the library. Which statement properly loads the static resource within the LWC? import {jsUtilities} from '@salesforce/reaourceUrljsUtila'; import jUtilities from '@salesforce/reaourceUrljsUtila'; const jsUtility = SA.get ('SReaource.jsUtils'); Ninguna 32. Consider the following code snippet, depicting an Azure component: Which two interfaces can the developer implement to make the component available as a quick action? Force:lightningQuicAction Force:hasRecordId Lightning QuickActionAPI Force:lightningQuickActionWithoutHeader Force hasObjectName 33. An Apex trigger creates an Order__c record every time an Opportunity is won by a Sales Rep. Recently the trigger is creating two orders. What is the optimal method for a developer to troubleshoot this? Set up debug logging for every Sales Rep, then monitor the logs for errors and exceptions. Turn off all Workflow Rules, then turn them on one at time to see which one causes the error. add system.debug() statements to the code and use the Developer Console logs to trace the code. Run the Apex Test Classes for the Apex trigger to ensure the code still has sufficient code coverage. Ninguna 34. What Salesforce tool lets you deploy/retrieve metadata, check status of apex jobs, and check responses of REST calls? Streaming API Force.com Migration Tool Workbench Developer Console Ninguna 35. Part of a custom Lightning Component displays the total number of Opportunities in the org, which is in the millions. The Lightning Component uses an Apex Controller to get the data it needs. What is the optimal way for a developer to get the total number of Opportunities for the Lightning Component? Apex Batch job that counts the number of Opportunity records SOQL for loop that counts the number of Opportunities records COUNT() SOQL aggregate query on the Opportunity object SUM() SOQL aggregate query on the Opportunity object Ninguna 36. In a VisualForce page with a VisualForce component that has rendered set to false when the page loads, how can a developer ensure it will show on a re-render? Set the rendered attribute of the component to true and re-render the component. Set the rendered attribute of the component to true and re-render a parent component. Set the re-render attribute of the component to true. Perform a full page refresh since rendered elements cannot be re-rendered without refreshing. Ninguna 37. 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 CaseExtensionTwo will be executed Save from Case Standard Controller will be executed Save from CaseExtensionOne will be executed Ninguna 38. A developer is using a third-party JavaScript library to create a custom user interface in Visualforce. The developer needs to use JavaScript to get data from a controller method in response to a user action. How can the developer accomplish this? Use the $Controller global variable to access the controller method via JavaScript Use to create a JavaScript wrapper for the controller method Use the @RemoteAction annotation on the method definition with JavaScript Remoting Use to enable JavaScript support for the controller method Ninguna 39. Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers' sales representatives can edit the orders on the same Visualforce page. What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page? Use System.profllels() to test as an administrator and a community user, Use System.runAs() to test as an administrator and a community user. Use System.runAs() to test as a sales rep and a community user. Use System.profilels() to test as a sales rep and a community user. Ninguna 40. 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 41. Which use case can only be performed by using asynchronous Apex? Scheduling a batch process to complete in the future Processing high volumes of records Calling a web service from an Apex trigger Updating a record after the completion of an insert Ninguna 42. A company has the Lightning Component above that allows users to click a button to save their changes and redirects them to a different page. Currently, when the user hits the Save button the records are getting saved, but they are not redirected. Which three techniques can a developer use to debug the JavaScript? Choose 3 answers Use Developer Console to view the debug log. Enable Debug Mode for Lightning components for the user. Use Developer Console to view checkpoints. Use the browser's dev tools to debug the JavaScript. Use consde.log() messages in the JavaScript. 43. An Apex class does not achieve expected code coverage. The testSetup method explicitly calls a method in the Apex class. How can the developer generate the code coverage? Verify the user has permissions passing a user into System.runAs(). Call the Apex class method from a testMethod instead of the testSetup method. Add @testVisible to the method in the class the developer is testing. Use system.assert() in testSetup to verify the values are being returned. Ninguna 44. Which type of controller is best suited when you want all of the basic DML functions from an object's normal new/edit page? Standard List/Set Controller Custom Controller Standard Controller Controller Extensions Ninguna 45. 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? 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. Create a cross-reference table in the custom invoicing system with the Salesforce Account ID of each Customer and insert invoice data nightly. Query the Account Object upon each call to insert invoice data to fetch the Salesforce ID corresponding to the Customer Number on the invoice Use Salesforce Connect and external data objects to seamlessly import the invoice data into Salesforce without custom code. Ninguna 46. A developer is trying to access org data from within a test class. Which sObject type requires the test class to have the (seeAllData=true) annotation? Profile RecordType User Report Ninguna 47. A developer built a Component to be used at the front desk for guests to self-register upon arrival at a kiosk. The developer is now asked to create a Component for the Utility Tray to alert Users whenever a guest has arrived at the front desk. What should be used? Application Event Component Event Changelog DML Operation Ninguna 48. A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex. How can the developer meet these requirements? (Choose two.) Use CURSOR 50 in SOQL queries Use LIMIT 50 in SOQL queries Use OFFSET in SOQL queries Use a StandardSetController 49. Ursa Major Solar has a custom object, serviceJcb__c, with an optional Lookup field to Account called Partr,er_service_Provider__c. The TocaUobs__c field on Account tracks the total number of serviceJcb__o records to which a partner service provider Account is related. What should be done to ensure that the TotalJobs_c field is kept up to date? Change TotalJobi__a to a roll-up summary field. Create an Apex trigger on serviceJob__c Implement a workflow cross-object field update. Build a Process Builder with an invocable action. Ninguna 50. Consider the controller code above that is called from a Lightning component and returns data wrapped in a class. Consider the controller code above that is called from a Lightning component and returns data wrapped in a class. The developer verified that the Queries return a single record each and there is error handing in the Lightning component, but the component is not getting anything back when calling the controller getSomeData(). What is wrong? The member's Name and Option of the class MyDataWrapper should be annotated with @AuraEnabled too. Instances of Apex classes such as MyDataWrapper cannot be returned to a Lightning component. The member's Name and Option should not have getter and setter. The member's Name and Option should not be declared public. Ninguna 51. A lead developer is creating tests for a Lightning web component. The component re-renders when a property called bypassSelection. changes its value. What should the developer use to the test that the component re-renders successfully when the property changes? Promise. resolve ( ) Windows, set State ( ) Windows, Setinterval ( ) dispatchEvent (new CustomEvent (' bypassSelection')) Ninguna 52. 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 53. The progress of an apex job queued is using the System.enqueueJob method and needs to be monitored. Which options are valid? (Choose two.) Use the Scheduled Jobs page in setup Query the AsyncApexJob record Use the Apex Jobs page in setup Query the Queueable Apex record 54. 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 Sales_Help_Request__c A roll-up summary field on the Opportunity object A workflow rule on the Sales_Help_Request__c object A trigger on the Opportunity object Ninguna 55. Which of the following about Dynamic Apex is incorrect? You can retrieve the sObject type from an Id by calling .getSObjectTypeQ getDescribe() can get you a variety of info on a particular object/field Schema.getGlobalDescribeQ gives you a map of all sObject In dynamic SOQL, you can use bind variables and bind variable fields Ninguna 56. A developer must create a way for external partners to submit millions of leads into Salesforce per day-How should the developer meet this requirement? Create a web service on Heroku that uses Heroku Connect Host a Web-to-Lead form on the company website Publicly expose an Apex Web Service via Force.com Sites Publicly expose a Visualforce page via Force.com Sites Ninguna 57. A developer is developing a reuseable Aura Component that will reside on an sObject Lightning Page with the following HTML snippet: Add force:hasSobjectName to the implements. Create a design attribute and configure via App builder. Set the sObject type as a component attribute. Use the getSObjectTypeQ method in an Apex class. Ninguna 58. What is a valid request for the following REST method? (Choose two.) @HttpPost global static void myPostMethod(String si, Integer il, Boolean bl, String 52) my first string 123 my second string false il" : 123, "SI" : "my first string", "S2" : "my second string", "bl" : false "my first string" 123 !,my second string" false si" : "my first string", 11" : "123", "bl" : "false", "S2" : "my second string" 59. Which scenario requires a developer to use an Apex callout instead of Outbound Messaging? The Target system uses a REST API. The Target system uses a SOAP API. The callout needs to be asynchronous. The callout needs to be invoked from a Workflow Rule. Ninguna 60. A lead developer for a Salesforce organization needs to develop a page-centric application that allows the user to interact with multiple objects related to a Contact The application needs to implement a third-party JavaScript framework such as Angular, and must be made available in both Classic and Lightning Experience. Given these requirements, what is the recommended solution to develop the application? Aura Components Visualforce Lightning Web Components Lightning Experience Builder Ninguna Time's upTime is Up!