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




Comentarios |
---|
NO HAY REGISTROS |
Universal Containers (UIC) processes orders in Salesforce in a custom object, Order__c.They also allow sales reps to upload CSV files with thousands of order at a time. A developer is tasked with integrating orders placed in Salesforce with UC's enterprise resource planning (ERP) system. After the status for an Order__c is first set to 'Placed', the order information must be sent to a REST endpoint in the ERP system that can process one order at a time. What should the developer implement to accomplish this?. Flow with a callout from an invocable method. Callout from a Batchable class called from a scheduled job. Callout from a Queueable class called from a trigger. Callout from an @future method called from a trigger. A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class. public virtual class Payment { public virtual void makePayment (Decimal amount) { /* implementation */ } } Which is the correct implementation?. public class CreditCardPayment extends Payment { public virtual void makePayment (Decimal amount) { /* implementation */ } }. public class CreditCardPayment implements Payment { public virtual void makePayment (Decimal amount) { /* implementation */ } }. public class CreditCardPayment extends Payment { public override void makePayment (Decimal amount) { /* implementation */ } }. public class CreditCardPayment implements Payment { public override void makePayment (Decimal amount) { /* implementation */ } }. A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components. Which annotation should the developer add to the Apex method to achieve this?. @AuraEnable (cacheable=true). @RemoteAction (cacheable=true). @RemoteAction. @AuraEnable. Which two sfdx commands can be used to add testing data to a Developer sandbox? Choose 2 answers. force|data|bulk|upsert. force|data|object|create. force|data|async|upsert. force|data|tree|import. Which code statement includes an Apex method named updateAccounts in the class AccountController for use in a Lightning web component?. import updateAccounts from '@salesforce/apex/AccountController';. import updateAccounts from 'AccountController.updateAccounts';. import updateAccounts from 'AccountController';. import updateAccounts from '@salesforce/apex/AccountController.updateAccounts';. A developer is creating an app that contains multiple Lightning web components. One of the child components is used for navigation purposes. When a user clicks a button called Next in the child component, the parent component must be alerted so it can navigate to the next page. How should this be accomplished?. Update a property on the parent. Call a method in the Apex controller. Create a custom event. Fire a notification. A PrimaryId__c custom field exists on the Candidate__c custom object. The field is used to store each candidate's id number and is marked as Unique in the schema definition. As part of a data enrichment process, Universal Containers has a CSV file that contains updated data for all candidates in the system. The file contains each Candidate's primary id as data point. Universal Containers wants to upload this information into Salesforce, while ensuring all data rows are correctly mapped to candidate in the system. Which technique should the developer implement to streamline the data upload?. Upload the CSV into a custom object related to Candidate__c. Create a before insert trigger to correctly map the records. Create a before save flow to correctly map the records. Update the PrimaryId__c field definition to mark it as an External Id. An org has an existing flow that creates an Opportunity with an Update Records element. A developer must update the flow to also create a Contact and store the created Contact's ID on the Opportunity. Which update must the developer make in the flow?. Add a new Update Records element. Add a new Roll Back Records element. Add a new Get Records element. Add a new Create Records element. 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 the 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 roll-up summary field on the Opportunity object. A record-triggered flow on the Sales_Help_Request__c object. A roll-up summary field on the Sales_Help_Request__c object. Which three statements are true regarding custom exceptions in Apex? Choose 3 answers. A custom exception class name must end with “Exception”. A custom exception class can implement one or many Interfaces. A custom exception class can extend other classes besides the Exception class. A custom exception class cannot contain member variables or methods. A custom exception class must extend the system Exception class. A developer created a trigger on the Account object and wants to test if the trigger is properly bulkfied. The developer team decided that the trigger should be tested with 200 account records with unique names. What two things should be done to create the test data within the unit test with the least amount of code? Choose 2 answers. Create a static resource containing test data. Use Test.loadData to populate data in your test methods. Use the @isTest (seeAllData=true) annotation in the test class. Use the @isTest (isParallel=true) annotation in the test class. Consider the following code snippet: public static List <Lead> obtainAllFields (Set<Id> leadIds) { List <Lead> result = new List <Lead> (); for (Id leadId : leadIds) { result.add ([SELECT FIELDS(ALL) FROM Lead WHERE Id =: leadId]); } return result; } Given the multi-tenant architecture of the Salesforce platform, what is a best practice a developer should implement and ensure successful execution of the method?. Avoid executing queries without a limit clause. Avoid using variables as query filters. Avoid returning an empty List of records. Avoid performing queries inside for loops. A custom object Tariner__c has a lookup field to another custom object Gym__c. Which SOQL query will get the record far the Viridian City Gym and all it's trainers?. SELECT id, {SELECT id FROM Trainers__c} FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT id, {SELECT id FROM Trainer__c} FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT id, {SELECT id FROM Trainers__r} FROM Gym__c WHERE Name = 'Viridian City Gym'. SELECT id FROM Trainer__c WHERE Gym__r.Name = 'Viridian City Gym'. What does the Lightning Component framework provide to developers?. Templates to create custom components. Support for Classic and Lightning UIs. Prebuilt components that can be reused. Extended governor limits for applications. Which Salesforce org has a complete duplicate copy of the production org including data and configuration?. Full Sandbox. Production. Developer Pro Sandbox. Partial Copy Sandbox. A developer wants to mark each Account in a List <Account> as either Active or Inactive, based on the value in the LastModifiedDate field of each Account being greater than 90 days in the past. Which Apex technique should the developer use?. A for loop, with 8 switch statement inside. A for loop, with an if-else statement inside. A switch statement, with a for loop inside. An if-else statement, with a for loop inside. A developer is writing tests for a class and needs ta insert records to validate functionality. Which annotation method should be used to create records for every method in the test class?. @isTest {SeeAllData=true}. @PreTest. @TestSetup. @StartTest. Universal Containers has implemented an order management application. Each Order can have one or more Order Line items. The Order Line object is related to the Order via a master-detail relationship. For each Order Line item, the total price is calculated by multiplying the Order Line em price with the quantity ordered. What is the best practice to get the sum of all Order Line item totals on the Order record?. Quick action. Roll-up summary field. Formula field. Apex trigger. While working in a sandbox, an Apex test fails when run in the Test Framework. However, running the Apex test logic in the Execute Anonymous window succeeds with no exceptions or errors. Why did the method fail in the sandbox test framework but succeed i the Developer Console?. The test method relies on existing data in the sandbox. The test method does not use System.runAs to execute as a specific user. The test method is calling an @future method. The test method has a syntax error in the code. Refer to the following code snippet, that i part of a custom controller for a Visuslforce page: public void updateContact (Contact thisContact) { thisContact.Is_Active__c = false; try { Update thisContact; } catch (Exception e) { String errorMessage = 'An error occurred while updating this Contact.' '+=.get.Message()'; ApexPages.addmessage (new ApexPage.message (ApexPage.severity.FATAL.errorMessage )) } } In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the current logged-in user does not have the appropriate level of access? Choose 2 answers. Use if (Schema.sObjectType.Contact.fields.Is_Active__c.isUpdateable()). Use if (Schema.sObjectType.Contact.isAccessible()). Use if (thisContact.OwnerId == UserInfor.getUserId()). Use if (Schema.sObjectType.Contact.isUpdateable()). A business has a proprietary Order Management System (OMS) that creates orders from their website and fulfils the orders. When the order is created in the OMS, an integration also creates an order record in Salesforce and relates it to the contact as identified by the email on the order. As the order goes through different stages in the OMS, the integration also updates it in Salesforce. It is noticed that each update from the OMS creates a new order record in Salesforce. Which two actions will prevent the duplicate order records from being created in Salesforce? Choose 2 answers. Use the email on the contact record as an external ID. Ensure that the order number in the OMS is unique. Write a before trigger an the order object to delete any duplicates. Use the order number from the OMS as an external ID. A developer has the following requirements: - Calculate the total amount on an Order. - Calculate the line amount for each Line Item based on quantity selected and price. - Move Line Items to a different Order if a Line Item is not in stock. Which relationship implementation supports these requirements on its own?. Order has a re-parentable master-detail field to Line Item. Line Item has a re-parentable master-detail field to Order. Line Item has a re-parentable lookup field to Order. Order has a re-parentable lookup field to Line Item. A lead developer creates an Apex interface called Laptop. Consider the following code snippet: public class SilverLaptop { //code implementation } How can a developer use the Laptop Interface within the SilverLaptop class?. public class SilverLaptop extends Laptop. public class SilverLaptop implements Laptop. @Extends (class = "Laptop") public class SilverLaptop. @Interface (class="Laptop") public class SilverLaptop. Which two events need to happen when deploying to a production org? Choose 2 answers. All Workflow rules must have at least 1% test coverage. All Visual flows must have at least 1% test coverage. All triggers must have some test coverage. All Apex code must have at least 75% test coverage. Management asked for opportunities created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement. for (Account a: Trigger.new) { if (a.AnnualRevenue > 1000000) { List <Opportunity> oppList = [SELECT Id FROM Opportunity WHERE account =: a.Id]; if (oppList.size () == 0) { Opportunity oppty = new Opportunity (Name = a.name, StageName = 'Prospecting', CloseDate = system.today().addDays (30)); Insert oppty; } } } Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, it fails with system.Exception errors. Which two actions should the developer take to fix the code segment shown above? Choose 2 answers. Move the DML that saves opportunities outside the for loop. Check if ai the required fields for Opportunity are being added on creation. Use Database.query to query the opportunities. Query for existing opportunities outside the for loop. Which action may cause triggers to fire?. Changing a user's default division when the transfer division option is checked. Renaming or replacing a picklist entry. Updates to Feed Items. Cascading delete operations. 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 abject. Which two automation tools can be used to implement this feature? Choose 2 answers. Quick actions. Approval process. Fast Field Updates record-triggered flow. Account trigger. AW Computing tracks order information in custom objects called Order__c and Order_Line__r. Currently, all shipping information is stored in the Order__c object. The company wants to expand its order application to support split shipments so that any number of Order_Line__c records on a single Order__c can be shipped to different locations. What should a developer add to fulfil this requirement?. Oder_Shipment_Group__c object and master-detail field on Order__c. Oder_Shipment_Group__c object and master-detail field to Order__c and Order_Line__c. Oder_Shipment_Group__c object and master-detail field on Order_line__c. Oder_Shipment_Group__c object and master-detail field on Order_Shipment_Group__c. Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers. What should a developer change about the Visualforce page to help with the page load errors?. Implement pagination with an OffsetCantrofer. Use lazy loading and a transient List variable. Implement pagination with a StandardSetControlier. Use JavaScript remoting with SOQL Offset. The Account object in an organization has a master-detail relationship to a child object called Branch. The following automation exist: Roll-up summary fields Custom validation rules Duplicate rules A developer created a trigger on the Account object. Which two things should the developer consider while testing the trigger code? Choose 2 answers. The trigger may fire multiple times during a transaction. Rollup summary fields can cause the parent record to go through Save. Duplicate rules are executed once all DML operations commit to the database. The validation rules will cause the trigger to fire again. Universal Containers wants Opportunities to no longer be editable when reaching the Closed/Won stage. How should a developer accomplish this?. Use the Process Automation settings,. Mark fields as read-only on the page layout. Use Flow Builder. Use a validation rule. A developer is integrating with a legacy on-premise SQL database. What should the developer use to ensure the data being integrated is matched to the right records in Salesforce?. External Object. External ID field. Formula field. Lookup field. What are three capabilities of the <ltng: require> tag when loading JavaScript resources in Aura components? Choose 3 answers. Loading externally hosted scripts. Specifying loading order. Loading scripts in parallel. One-time loading for duplicate scripts. Loading files from Documents. A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineltem trigger. Which method allows access to the price book?. Use Test.getStandardPricebookId() to get the standard price book ID. Use Test.loadData() and a static resource to load a standard price book. Use @TestVisible to allow the test method to see the standard price book. Use @IsTest(SeeAllData=true) and delete the existing standard price book. When importing and exporting data into Salesforce, which two statements are true? Choose 2 answers. Bulk API can be used to bypass the storage limits when importing large data volumes in development environments. Data import wizard is an application that is installed on your computer. Bulk API can be used to import large data volumes In development environments without bypassing the storage limits. Developer and Developer Pro sandboxes have different storage limits. What are three considerations when using the @InvocableMethod annotation in Apex? Choose 3 answers. A method using the @InvocableMethod annotation can be declared as Public or Global. Only one method using the @InvocableMethod annotation can be defined per Apex class. A method using the @InvocableMethod annotation can have multiple input parameters. A method using the @InvocableMethod annotation must be declared as static. A method using the @InvocableMethod annotation must define a return value. A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank. Which automation allows the developer to satisfy this requirement in the most efficient manner?. An approval process on the Opportunity object. A record trigger flow on the Opportunity object. An error condition formula on a validation rule on Opportunity. An Apex trigger on the Opportunity object. 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): } try { Database.update (casesToUpdate.false); } catch (Exception e) { System.debug (e.getMessage ()); } What should a developer consider for an environment that has over 10,000 Case records?. The transaction will fail due to exceeding the governor limit. The transaction will succeed and changes will be committed. The try-catch block will handle any DML exceptions thrown. The try-catch block will handle exceptions thrown by governor limits. Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?. init(). registerEvent(). fire(). fireEvent(). A developer created these three Rollup Summary fields 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 requirement in order to minimize maintenance overhead?. Roll-up summary field. Formula field. Record-triggered flow. Apex trigger. For which three items can a trace flag be configured? Choose 3 answers. Apex Trigger. Flow. Apex Class. User. Visualforce. What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers"?. SELECT Lead.Id, Lead.Name, Account.Id, Account.Name, Contact.Id, Contact.Name FROM Lead, Account, Contact WHERE CompanyName = 'Universal Containers'. FIND 'Universal Containers' IN Name Fields RETURNING lead (id, name), account (id, name), contact (id, name). SELECT lead (id, name), account (id, name), contact (id, name) FROM Lead, Account, Contact WHERE Name = 'Universal Containers'. FIND 'Universal Containers' IN CompanyName Fields RETURNING lead(id, name), account(id, name), contact(id, name). Which three resources in an Aura component can contain Javascript functions? Choose 3 answers. Style. Renderer. Controller. Design. Helper. A developer is implementing an Apex class for a financial system. Within the class, the variables 'creditAmount' and 'debitAmount' should not be able to change once a value is assigned. In which two ways can the developer declare the variables to ensure their value can only be assigned one time? Choose 2 answers. Use the final keyword and assign its value when declaring the variate. Use the static keyword and assign its value in a static initializer. Use the static keyword and assign its value in the class constructor. Use the final keyword and assign its value in the class constructor. Universal Containers has a large number of custom applications that were built using a third-party JavaScript framework and exposed using Visualforce pages. The company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?. Rewrite all Visualforce pages as Lightning components. Enable Available for Lightning Experience, Lightning Communities, and the mobile app on Visualforce pages used by the custom application. Set the attribute enableLightning to true in the definition. Incorporate the Salesforce Lightning Design System CSS stylesheet into the JavaScript applications. 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. SFDX CLI. Developer Console. Change Sets. VSCode. What is the result of the following code? Account a = new Account (); Database.insert (a, false);. The record will not be created and an exception will be thrown. The record will be created and a message will be in the debug log. The record will not be created and no error will be reported. The record will be created and no error will be reported. A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class. Which code segment shows the correct declaration of the class and methods?. webservice class WebServiceClass { private Boolean helperMethod () { /* implementation ... */ } webservice static String updateRecords() { /* implementation ... */ } }. webservice class WebServiceClass { private Boolean helperMethod () { /* implementation ... */ } global static String updateRecords() { /* implementation ... */ } }. global class WebServiceClass { private Boolean helperMethod () { /* implementation ... */ } global String updateRecords() { /* implementation ... */ } }. global class WebServiceClass { private Boolean helperMethod () { /* implementation ... */ } webservice static String updateRecords() { /* implementation ... */ } }. Where are two locations a developer can look to find information about the status of batch or future methods? Choose 2 answers. Apex Flex Queue. Paused Flow Interviews component. Developer Console. Apex Jobs. A developer must write an Apex method that will be called from a Lightning component. The method may delete an Account stored in the accountRec variable. Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletions?. accountRec.isDeletable(). Account.isDeletable(). accountRec.sObjectType.isDeletable(). Schema.sObjectType.Account.isDeletable(). A developer is creating a Lightning web component ta show a list of sales records. The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field. How should this be enforced so that the component works for both users without showing any errors?. Use security.stripInaccessible to remove fields inaccessible to the current user. Use Lightning Locker Service to enforce sharing rules and field-level security. Use Lightning Data Service to get the collection of sales records. Use WITH SECURITY_ENFORCED in the S0QL that fetches the data for the component. Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers. <apex:algs/>. $Lightning.use. $Lightning.createComponent. $Lightning.useComponent. <apex: includeLightning/>. When using Salesforce DX, what does a developer need to enable to create and manage scratch orgs?. Dev Hub. Production. Environment Hub. Sandbox. A developer must provide custom user interfaces 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 Visualforce page in Salesforce Classic and a Lightning component in Lightning Experience. 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. Which two statements are true about using the @testSetup annotation in an Apex test class? Choose 2 answers. A method defined with the @testSetup annotation executes once for each test method in the test class and counts towards system limits. The @testSetup annotation is not supported when the @isTest{SeeAlData=True) annotation is used. Records created in the test setup method cannot be updated in individual test methods. In a test setup method, test data is inserted once and made available for all test methods in the test class. Refer to the following Apex code: Interger 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. What are three ways for a developer to execute tests in an org? Choose 3 answers. Bulk API. Salesforce DX. Setup Menu. Metadata API. Tooling API. Universal Containers recently transitioned from Classic to Lightning Experience. One of its business processes requires certain values from the Opportunity object to be sent via an HTTP REST callout to its external ordermanagement system based on an ad-hoc basis 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 component that performs the HTTP REST callout, and use a Lightning Action to expose the component on the Opportunity detail page. Create an after update 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, and use a Visualforce quick 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. What should be used to create scratch orgs?. Salesforce CLI. Workbench. Sandbox refresh. Developer Console. 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. Future method. Invocable method. Trigger. Flow. |