Dev I - Set 3
![]() |
![]() |
![]() |
Título del Test:![]() Dev I - Set 3 Descripción: Platform Developer 1 SFDC SUM23 - SET 3 |




Comentarios |
---|
NO HAY REGISTROS |
What can be used to override the Accounts standard Edit button for Lightning Experience?. Lightning component. Lightning action. Lightning flow. Lightning page. Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?. fire(). registerEvent(). fireEvent(). init(). The values 'High', 'Medium', and 'Low' are identified as common values for multiple picklists across different objects. What is an approach a developer can take to streamline maintenance of the picklists and their values, while also restricting the values to the ones mentioned above?. Create the Picklist on each object and add a validation rule to ensure data integrity. Create the Picklist on each object and select "Restrict picklist to the values defined in the value set”. Create the Picklist on each object as a required field and select "Display values alphabetically, not in the order entered". Create the Picklist on each object and use a Global Picklist Value Set containing the values. Universal Containers decides to use purely declarative development to build out a new Salesforce application. Which two options can be used to build out the business logic layer for this application? Choose 2 answers. Validation Rules. Remote Actions. Record-Triggered Flow. Batch Jobs. Ursa Major Solar has a custom object, ServiceJob__c, with an optional Lookup field to Account called Partner_Service_Provider__c. The TotalJobs__c field on Account tracks the total number of ServiceJobs__c records to which a partner service provider Account is related. What is the most efficient way to ensure that the TotalJobs__c field is kept up to date?. Change TotalJobs__c to a roll-up summary field. Create a record-triggered flow on ServiceJob__c. Create an Apex trigger on ServiceJob__c. Create a schedule-triggered flow on ServiceJob__c. For which three items can a trace flag be configured? Choose 3 answers. Apex Trigger. Visualforce. Apex class. Flow. User. 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 property deploy the modification to the production environment? Choose 2 answers. All methods in the test classes must use @isTest. Test methods must be declared with the testMethod keyword. At least one line of code must be executed for the Apex trigger. Apex classes must have at least 75% code coverage org-wide. Which three statements are true regarding custom exception in Apex? Choose 3 answers. A custom exception class cannot contain member variables or methods. A custom exception class must extend the system Exception class. A custom exception class can extend other classes besides the Exception class. A custom exception class name must end with "Exception". A custom exception class can implement one or many interfaces. How should a developer write unit tests for a private method in an Apex class?. Use the SeeAllData annotation. Add a test method in the Apex class. Mark the Apex class as global. Use the TestVisible annotation. 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 <target>lightning_RecordPage</target> to the statusComponent.js-meta.xml file. Add <target>lightning_RecordPage</target> to the statusComponent.js file. Add <masterLabel>Account</masterLabel> to the statusComponent.js-meta.xml file. Set isExposed to true in the statusComponent.js.meta.xml file. A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations. Which type of Salesforce orgs should they use for their development?. Developer orgs. Full Copy sandboxes. Developer sandboxes. Scratch orgs. A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what is defined for payments in the PaymentProcessor Interface. public Interface PaymentProcessor { void pay (Decimal amount); } Which implementation is correct to use the PaymentProcessor interface class?. public class CheckPaymentProcessor implements PaymentProcessor{ public void pay (Decimal amount); { //functional code here } }. public class CheckPaymentProcessor extends PaymentProcessor{ public void pay (Decimal amount); { //functional code here } }. In terms of the MVC paradigm, what are two advantages of implementing the view layer of a Salesforce application using Lightning Web Component-based development over Visualforce? Choose 2 answers. Rich component ecosystem. Self-contained and reusable units of an application. Log capturing via the Debug Logs Setup page. Built-in standard and custom set controllers. Which two scenarios require an Apex method to be called imperatively from a Lightning web component? Choose 2 answers. Calling a method that makes a web service callout. Calling a method that is not annotated with cacheable=true. Calling a method with the click of a button. Calling a method that is external to the main controller for the Lightning web component. A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org. Which tool should the developer use to troubleshoot?. Setup Menu. Visual Studio Code IDE. Developer Console. AppExchange. 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 isAccessible() method must be used for field-level access checks. Lightning Data Service handles sharing rules and field-level security. Lightning Data Service ignores field-level security. The with sharing keyword must be used to enforce sharing rules. Universal Containers has a support process that allows users to request support from its engineering team using a 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 should be shown on the Opportunity record. Which relationship field should be implemented to support these requirements?. Master-detail field from Engineering_Support__c to Opportunity. Lookup field from Opportunity to Engineering_Support__c. Master-detail field from Opportunity to Engineering_Support__c. Lookup field from Engineering_Support__c to Opportunity. Which three resources in an Aura component can contain JavaScript functions? Choose 3 answers. Design. Controller. Helper. Style. Renderer. A developer needs to create a baseline set of data (Accounts, Contacts, Products, Assets) for an entire suite of tests allowing them to test independent requirements for various types of Salesforce Cases. Which approach can efficiently generate the required data for each unit test?. Use @TestSetup with a void method. Create test data before Test.startTest() in the unit test. Create a mock using the Stub API. Add @IsTest (seeAllData=true) at the start of the unit test class. Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightning web component? Chase 3 answers. Import the static resource and provide a JavaScript property for it. Reference the property in the HTML template. Import the SVG as a content asset file. Upload the SVG as a static resource. Reference the import in the HTML template. Universal Containers (UC) wants to lower its shipping cost while making the shipping process more efficient. The Distribution Officer advises UC to implement global addresses to allow multiple Accounts to share a default pickup address.The developer is tasked to create the supporting object and relationship for this business requirement and uses the Setup Menu to create a custom object called “Global Address”. Which field should the developer add to create the most efficient model that supports the business need?. Add a master-detail field on the Global Address object to the Account object. Add a lookup field on the Global Address object to the Account object. Add a master-detail field on the Account object to the Global Address object. Add a lookup field on the Account object to the Global Address object. Universal Containers recently transitioned from Classic to Lightning Experience: One of its business requires certain values from Opportunity object to be sent via an HTTP REST callout to its external order management system based on an ad-hoc when the user presses a custom button on the Opportunity detail page. Example values are as follows: * Name * Amount * Account Which two methods should the developer implement to fulfill the business requirement? Choose 2 answers. Create a Lightning compornent that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page. Create a Remote Action on the Opportunity object that executes an Apex immediate action to perform the HTTP REST callout whenever the Opportunity is updated. Create an after update trigger on the Opportunity object that calls a helper method using @Future(Callout=true) to perform the HTTP REST callout. Create a Visualforce page that performs the HTTP REST callout, an use a Visualforce quick action to expose the component on the Opportunity detail page. An Opportunity needs to have an amount rolled up from a custom object that is not in a master-detail relationship. How can this be achieved?. Write a trigger on the child object and use an aggregate function to sum the amount for all related child objects under the opportunity. Write a trigger on the Opportunity object and use an aggregate function to sum the amount for all related child objects under the Opportunity. Use the Metadata API to create real-time roll-up summaries. Use the Streaming API to create real-time roll-up summaries. A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles. Which two tools can they use to run a script that deploys to a sandbox? Choose 2 answers. Developer Console. SFDX CLI. Ant Migration Tool. Change Sets. A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database. Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits? Choose 2 answers. Use partial DML statements to ensure only valid data is committed. Use the System.Limit class to monitor the current CPU governor limit consumption. Use the Database.Savepoint method to enforce database integrity. Use the @ReadOnly annotation to bypass the number of rows returned by a SOQL. Given the following Anonymous block: List <Case> casesToUpdate = new List <Case> (); for (Case thisCase: [SELECT Id, Status FROM Case LIMIT 50000] ) { thisCase.Status = 'Working'; casesToUpdate.add(thisCase); } What should a developer consider for an environment that has over 10,000 Case records?. The transaction will succeed and changes will be committed. The transaction will fail due to exceeding the governor limit. The try-catch block will handle any DML exceptions thrown. The try-catch block will handle exceptions thrown by governor limits. 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?. Custom controller. Standard controller. Standard list controller. Lightning controller. A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple sObjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL. Which three statements are useful inside the unit test to effectively test the custom controller? Choose 3 answers. Test.setCurrentPage(pageRef);. String nextPage = controller.save().getUrl[];. insert pageRef;. public ExtendedController(ApexPages.StandardController ctrl)[]. ApexPages.currentPage().getParameters[].put('input', 'TestValue');. When a user edits the Postal Code on an Account, a custom Account text field named 'Timezone' must be updated based on the values in a PostalCodeToTimezone__c custom object. Which two automation tools can be used ta Implement this feature? Choose 2 answer. Approval process. Fast Field Updates record-triggered flow. Quick action. Account trigger. A developer creates a new Apex trigger with a helper class, and writes a test class that only exercises 95% coverage of the new Apex helper class. Change Set deployment to production fails with the test coverage warning: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required." What should the developer do to successfully deploy the new Apex trigger and helper class. Remove the failing test methods from the test class. Create a test class and methods to cover the Apex trigger. Run the tests using the 'Run All Tests' method. Increase the test class coverage on the helper class. Universal Containers hires a developer to build a custom search page to help users find the Accounts they want. Users will be able to search on Name, Description, and a custom comments field. Which consideration should the developer be aware of when deciding between SOQL and SOSL? Choose 2 answers. SOSL is able to return more records. SOQL is able to return more records. SOSL is faster for text searches. SOQL is faster for text searches. A developer created this Apex trigger that calls MyClass.myStaticMethod: trigger myTrigger on Contact(before insert) { MyClass.myStatitcMethod(trigger.new); } The developer creates a test class with a test method that calls MyClass.myStaticMethod directly, resulting in 81% overall code coverage. What happens when the developer tries to deploy the trigger and two classes to production, assuming no other code exists?. 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 the Apex code has the required 75% code coverage. The deployment passes because both classes and the trigger were included in the deployment. How does the Lightning Component framework help developers implement solutions faster?. By providing device-awareness for mobile and desktops. By providing code review standards and processes. By providing change history and version control. By providing an Agile process with default steps. Which statement describes the execution order when triggers are associated to the same object and event?. Triggers are executed in the order they are created. Trigger execution order cannot be guaranteed. Triggers are executed in the order they are modified. Triggers are executed alphabetically by trigger name. 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?. Messaging. Limits. Exception. OrgLimits. Universal Containers (UC) is developing a process for their sales teams that requires all sales reps to go through a set of scripted steps with each new customer they create. n the first step of collecting information, UC's ERP system must be checked via a REST endpoint to see if the customer exists. If the customer exists, the data must be presented to the sales rep in Salesforce. Which two should a developer implement to satisfy the requirements? Choose 2 answers. Invocable method. Trigger. Future method. Flow. Which two are best practices when it comes to Aura component and application event handling? Choose 2 answers. Reuse the event logic in a component bundle, by putting the logic in the helper. Use component events to communicate actions that should be handled at the application level. Try to use application events as opposed to component events. Handle low-level events in the event handler and re-fire them as higher-level events. What are two ways a developer can get the status of an enqueued job for a class that implements the queueable interface? Choose 2 answers. View the Apex Jobs page. View the Apex Flex Queue. Query the AsyncApexJob object. View the Apex Status page. A developer has a Visualforce page and custom controller to save Account records. The developer wants to display any validation rule violations to the user. How can the developer make sure that validation rule violations are displayed?. Add custom controller attributes to display the message. Include <apex:messages> on the Visualforce page. Use a try/catch with a custom exception class. Perform the DML using the Database.upsert() method. A developer created these three Rollup Summary field in 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. Which should the developer use to implement the business in order to minimize maintenance overhead?. Roll-up summary field. Apex trigger. Formula field. Record-triggered flow. Which action causes a before trigger to fire by default for Accounts?. Importing data using the Data Loader and the Bulk API. Renaming or replacing picklists. Converting Leads to Contacts. Updating addresses using the Mass Address update tool. When a user edits the Postal Code on an Account, a custom Account text field named "Timezone" must be updated based on the values in another object called PostalCodeToTimezone__c. What is the optimal way to implement this feature?. Build an account assignment rule. Create an account approval process. Build a flow with Flow Builder. Create a formula field. A developer must provide custom user interface when users edit a Contact in either Salesforce Classic or Lightning Experience. What should the developer use to override the Contact's Edit button and provide this functionality?. A lightning page in Salesforce Classic and a Visualforce page in Lightning Experience. A Visualforce page in Salesforce Classic and a Lightning page in Lightning Experience. A Lightning component in Salesforce Classic and a Lightning component in Lightning Experience. A Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. A developer considers the following snippet of code: Boolean isOK; integer x; String theString = 'Hello'; if (isOK == false && theString == 'Hello') { x = 1; } else if (isOK == true && theString == 'Hello') { x = 2; } else if (isOK != null && theString == 'Hello') { x = 3; } else { x = 4; } Based on this code, what is the value of x?. 1. 2. 3. 4. A developer wants to import 500 Opportunity records into a sandbox. Why should the developer choose to use Data Loader instead of Data Import Wizard?. Data Loader runs from the developer's browser. Data Import Wizard can not import all 500 records. Data Loader automatically relates Opportunities to Accounts. Data Import Wizard does not support Opportunities. 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?. Formula field on Applicant that references Job. Lookup field from Applicant to Job. Master-detail field from Applicant to Job. Junction object between Applicant and Job. Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace. Which approach should a developer take to ensure calculateBody() is accessible outside the package namespace?. Declare the class and method using the global access modifier. Declare the class and method using the public access modifier. Declare the class as public and use the global access modifier on the method. Declare the class as global and use the public access modifier on the method. What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers. A method using the @InvocableMethod annotation can have multiple input parameters. A method using the @InvocableMethod annotation must define a return value. A method using the @InvocableMethod annotation must be declared as static. Only one method using the @InvocableMethod annotation can be defined per Apex class. A method using the @InvocableMethod annotation can be declared as Public or Global. While writing an Apex class, a developer wants to make sure that all functionality being developed is handled as specified by the requirements. Which approach should the developer use to be sure that the Apex class is working according to specifications?. Create a test class to execute the business logic and run the test in the Developer Console. Include a savepoint and Database.rollback(). Include a try/catch block to the Apex class. Run the code in an Execute Anonymous block in the Developer Console. The sales management team at Universal Containers requires that the Lead Source field of the Lead record be populated when a Lead is converted. What should be done to ensure that a user populates the Lead Source field prior to converting a Lead?. Use a formula field. Create an after trigger on Lead. Use Lead Conversion field mapping. Use a validation rule. Which two settings must be defined in order to update a record of a junction object? Choose 2 answers. Read/Write access on the primary relationship. Read/Write access on the secondary relationship. Read access on the primary relationship. Read/Write access on the junction object. A developer is debugging the following code to determine why Accounts are not being created. List <Account> accts = getAccounts(); //getAccounts implemented elsewhere Database.insert (accts, false); How should the code be altered to help debug the issue?. Collect the insert method return value in a SaveResult variable. Change the DML statement to insert accts. Set the second insert method parameter to true. Add a try-catch around the insert method. Refer to the following Apex code: Integer x = 0; do { x = 1; x++; } while (x < 1); System.debug (x); What is the value of x when it is written to the debug log?. 0. 1. 2. 3. Refer to the code snippet below: import fetchOpps from '@salesforce/apex/OpportunitySearch.fetchOpportunities'; @wire (fetchOpps) opportunities; When a Lightning web component is rendered, a list of opportunities that match certain criteria should be retrieved from the database and displayed to the end-use. Which three considerations must the developer implement to make the fetchOpportunities method available within the Lightning web component? Choose 3 answers. The method must specify the (cacheable=true) attribute. The method must specify the (continuation=true) attribute. The method must be annotated with the @InvocableMethod annotation. The method cannot mutate the result set retrieved from the database. The method must be annotated with the @AuraEnabled annotation. Universal Contain implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria the specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?. Use the with sharing keyword on the class declaration. Use the schema describe calls to determine if the logged-in user has access to the Account object. Use the UserInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user. Use the without sharing keyword on the class declaration. 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?. Create a junction object between OrderItem and Order. Add without sharing to the Apex class declaration. Select the Allow reparenting option on the master-detail relationship. Change the master-detail relationship to an external lookup relationship. Assuming that name is a String obtained by an <apex:inputText> tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection? Choose 2 answers. String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name.noQuotes() + '%\' '; List <Account> results = Database.query(query);. String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + name + '%\' '; List <Account> results = Database.query(query);. String query = '%' + name + '%'; List <Account> results = [SELECT Id FROM Account WHERE Name LIKE: query];. String query = 'SELECT Id FROM Account WHERE Name LIKE \'%' + String.escapeSingleQuotes(name) + '%\' '; List <Account> results = database.query(query);. Which two operations affect the number of times a trigger can fire. Choose 2 answer. Criteria-based sharing calculations. Roll-up summary fields. Lightning flows. Email messages. An org tracks customer orders using the Order and Line Item objects. The Line Item object has a master-detail relationship to the Order object. A developer has a requirement to calculate the total order amount for an Order and the line amount on each Line Item based on quantity and price. What is the correct implementation?. Implement the line item 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. Implement the line amount as a numeric formula field and the order amount as a roll-up summary field. Create a fast field update, record-triggered flow on the Line Item that calculates the item amount and order amount and updates the fields on the Line Item and the Order. What should be used to create scratch orgs?. Workbench. Salesforce CLI. Sandbox refresh. Developer Console. |