PD2

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

A developer is asked to develop a new AppExchange 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 Metadata

A developer needs to store variables to control the style and behavior of a Lightning Web Component. Which feature should be used to ensure that the variables are testable in both Production and all Sandboxes?

Custom Metadata

An org records customer order information in a custom object, order__c, that has fields for the shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a flat percentage rate associated with the region of the shipping address. What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?

Custom Metadata type

A developer is asked to find a way to store secret data with an ability to specify which profiles and users can access which secrets. What should be used to store this data?

Custom settings

What should a developer use to query all Account fields for the Acme Account in their Sandbox?

SELECT FIELDS(All) FROM Account WHERE Name = 'Acme' LIMIT 1

Consider the following queries. For these queries, assume that there are more than 200,000 Account records. These records include softdeleted records; that is, deleted records that are still in the Recycle Bin. Note that there are two fields that are marked as External Id on the Account. These fields are Customer_Number_c and ERP_Key_c. Which two queries are optimized for large data volumes?

SELECT Id FROM Account WHERE Name != '' AND Customer_Number_c = 'ValueA' SELECT ID FROM Account WHERE IS IN :aListVariable

A developer is debugging an Apex-based order creation process that has a requirement to have three savepoints, SP1, SP2, and SP3 (created in order), before the final execution of the process. During the final execution process, the developer has a routine to roll back to SP1 for a given condition. Once the condition is fixed, the code then calls a roll back to SP3 to continue with final execution. However, when the roll back to SP3 is called, a runtime error occurs. Why does the developer receive a runtime error?

SP3 became invalid when SP1 was rolled back.

A company needs to automatically delete sensitive information after seven years. This could delete almost a milltion records everything day. How can this be achieved?

Schedule a batch Apex process to run everyday that queries and deletes records older than 7 years.

The Salesforce admin at Cloud Kicks created a custom object called Region_c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to. Object Name: Region_c Fields: Zip_Code__c (Text) Region_Name_c (Text) Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code. Which code segment is the most efficient way to fulfill this request?

Set <String> zips = new Set<String>; for (Lead 1 : Trigger.new) { if(1. Postal Code != Null) { zips.add(1. Postal Code); } } List <Region__c> regions = [SELECT Zip_code_c, Region_Name_c FROM Region_c WHERE Zip_code__C IN :zips]; Map<string,String> zipMap = new Map< string,String >(); for (Region_c r regions) { zipMap.put (r.Zip_code_c, r. Region_Name__c); } for (Lead 1 : Trigger.new) { if (1. Postal Code != null) { Region_c = zipMap.get (1. Postal Code); } }

When developing a LWC, which setting displays lightning-layout-items in one column on small devices, such as mobile phones and in 2 columns on tablet-sized and desktop-size screens?

Set size="12" medium-device-size="6"

Universal Containers currently does all development in its full copy sandbox. Recently, UC has projects that require multiple developers to develop concurrently. UC is running into issues with developers making changes that cause errors in work done by other developers. Additionally, when they are ready to deploy, many unit tests fail which prevents the deployment. Which three types of orgs should be recommended to UC to eliminate the problems?

Staging org Data Migration org Development Org

What is a benefit of JS remoting over Visualforce Remote Objects?

Supports complex server-side application logic

A company represents their customers as Accounts that have an External ID field called Customer_Number__c. They have a custom Order (Order_c) object, with a Lookup to Account, to represent Orders that are placed in their external order management system (OMS). When an order is fulfilled in the OMS, a REST call to Salesforce should be made that creates an Order record in Salesforce and relates it to the proper Account. What is the optimal way to implement this?

Perform a REST PATCH to upsert the Order_c and specify the Account's Customer_Number_c in it.

An Apex trigger and Apex class increment a counter, Edit_Count_c, any time the Case is changed. public class CaseTriggerHandler { public static void handle (List <case> cases) { for (Case: cases) { c. Edit_Count_c = c.Edit_count_c + 1; } } } trigger on Case (before update) { CameTriggerHandler, handle (Trigger.new); } A new process on the Case object was just created in production for when a Case is created or updated. Since the process was added, there are reports that Edit_Count_c is being incremented more than once for Case edits. Which Apex code fixes this problem?

Public class Case TriggerHandler { public static Boolean first Run = true; public static void handle (List <case> cases) { for (Case c: cases) { c. Edit_count_c = c. Edit_Count__ + 1; } } } trigger on Case (before update) { if (CageTriggerHandler.firstRun) { CaseTrigger Handler.handle(Trigger.new); } CaseTriggerHandler. FirstRun = false; }

A developer is building a LWC that searches for Contacts and must communicate the search results to other LWCs when the search completes. What should the developer do to implement the communication?

Publish a message on a message channel.

Instead of waiting to send emails to support personnel directly from the finish method of a batch Apex Process, UC wants to notify an external system in the event that an unhandled exception occurs. What is the appropriate publish/subscribe logic to meet this requirement?

Publish the error event using the Eventbus.publish() method and have the external system subscribe to the event using Comet.

Which two best practices should the dev implement to optimize this code?

Query the Pricing_Structure__c records outside of the loop. Remove the DML Statement

A company recently deployed a Visualforce page with a custom controller that has a data grid of information about Opportunities in the org. Users report that they receive a "Maximum view state size limit" error message under certain conditions. According to Visualforce best practice, which three actions should the developer take to reduce the view state?

Refine any SOQL queries to return only data relevant to the page. Use filters and pagination to reduce the amount of data. Use the transient keyword in the Apex controller for variables that do not maintain state.

trigger AssignownerByRegion on Account ( before insert, before update) { List<Account> accountList = new List<Account>(); for (Account anAccount : trigger.new){ Region_c theRegion = [ SELECT id, Name, Region_Manager__ FROM Region WHERE Name = anaccount.Region Name__c]; anAccount. OwnerId = theRegion.Region_Manager_c; accountList.add( anaccount); } update accountList; } 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 Answer:

Remove the last line updating accountList as it is not needed. Move the Region_c query to outside the loop.

A dev is writing a Jest test for LWC that conditionally displays child components based on a user's checkbox selections. What should the dev do to properly test that the correct components display and hide for each scenario?

Rest the DOM after each test with the afterEach() method.

Which three Visualforce components can be used to initiate Ajax behavior to perform partial page updates?

<apex:commandButtons> <apex:commandLink> <apex:actionSupport>

A company wants to build a custom Aura component that displays a specified Account Field Set and that can only be added to the Account record page. Which design resource configuration should be used?

<design:component label="Account FS Component"> <design:attribute name="fieldSetName" label="Field Set Name"/> <sfdc:objects> <sfdc:object>Account</sfdc:object> </sfdc:objects> </design:component>

A company manages information about their product offerings in custom objects named Catalog and Catalog Item. Catalog Item has a master-detail fiels to Catalog and each Catalog may have as many as 100,000 Catalog Items. Both custom objects have a CurrencyIsoCode Text field that contains the currency code they should use. If a Catalog's CurrencyIsoCode changes, all its Catalog Items' CurrencyIsoCode should be changed as well. What should a developer use to update the CurrencyIdoCodes on the Catalog Items when the Catalog's CurrencyIsoCode changes?

A Database. Schedulable and Database. Batchable Class that queries Catalog Item objects and updates the Catalog Items if the Catalog CurrencyIsoCode is different.

global with sharing class MyRemoter{ public String accountName {get; set;}; public static Account account {get; set;}; public MyRemoter(){} @RemoteAction global static Account getAccount(String accountName){ account = [SELECT ID, Name, NumberEmployees FROM Account WHERE Name =: accountName]; return account; } } Consider the Apex class above that defines a Remote Action used on a Visualforce search page. Which code snipper will assert that the remote action returned the correct Account?

Account a = MyRemoter.getAccount("TestAccount"); System.assertEquals("TestAccount", a.Name);

A developer has a 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 'Ozone Electronics'?

Account a = [SELECT ID, Name, Type, (SELECT FirstName, LastName FROM Contacts) FROM Account WHERE name='Ozone Electronics' LIMIT 1];

Refer to the code snippet below: public void createChildRecord(String externalIdentifier)){ Account parentAccount; Contact newContact = new Contact(); newContact.Account = parentAccount; insert(newContact); } As part of an integration development effort, a new developer is tasked to create an Apex method that solely relies on the user of foreign Identifiers in order to relate new contact records to existing Accounts in Salesforce. The account object contains a field marked as an external ID, the API Name of this field is Legacy_Id__c. What is the most efficient way to instantiage the parentAccount variable on line 02 to ensure the newly created contact is properly related to the Account?

Account parentAccount = [SELECT ID FROM Account WHERE Legacy_Id__c = externalIdentifier];

A developer created a LWC that allows users to input a text value that is used to search for Accounts by calling an Apex method. The Apex method returns a list of Accountappers and is called imperatively from a JS event Handler. public class AccountSeacher { public static List<Accountappers> search(String term){ List<Accountapper> wrappers = getMatchingAccountappers(term); return wrappers; } public class Accountwrapper{ public Account (get; set;); public Decimal matchProbability (gets;set;); } /// Other methods } Which 2 changes should the developr make so the Apex method functions correctly?

Add Aura Enabled to lines 11 and 12 Add Aura Enabled to line 03

Users report that a button on a custom LWC is not working. However, there are no other details provided. What should the developer use to ensure error messages are properly displayed?

Add JS and HTML to display an error message. (Also maybe showToast methods if thats an answer)

When the test class runs, the assertion fails. Which change should the developer implement in the Apex test method to ensure the test method executes successfully?

Add System.runAs(User) to line 14 and enclose line 14 within Test.startTest() and Test.stopTest()

Which statement is considered a best practice for writing bulk safe Apex triggers?

Add records to collections and perform DLM operations against these collections.

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?

Add system.debug() statements to the code and use the Developer Console logs to trace the code

A dev is asked to create a LWC that will be invoked via a button on a record page. The component must be displayed in a modal dialog. Which three steps should the dev take to achieve this?

Add targetConfig and set targets to lightning_Record action In targets, add lightning_Record action as a target Set action type to screen action

Refer to the code below: Apex Class: public class OppController { public List<Opportunity > getTopOpps() { return [SELECT Name FROM Opportunity ORDER BY Amount DESC LIMIT 10]; } } Component markup: <aura:component> <aura:handler name="init" value="{this)" action="{!c.doInit)"/> </aura:component> Component controller: {{ doinit : function(cmp, event, helper) { var action = cmp.get ("c.getTopOpps"); action.setCallback(this, function (response){ var state = response.getState(); if (state == "SUCCESS") { console.log("From server:" + response.getReturnValue()); } }); $A.enqueuection (action); A developer is building this Aura component to display information about top Opportunities in the org. Which three code changes must be made for the component to work?

Add the static keyword to the Apex method. Set the controller in the component markup. Add the AuraEnabled annotation to the Apex method.

Refer to the following code snippet: public class LeadController { public static List <Lead> getFetchLeadList(String searcherm, Decimal Revenue) { String safeTerm = '%'+searchTerm.escapeSingleQuote() +'%' return [ SELECT Name, Company, Annual Revenue FROM Lead WHERE Annual Revenue >= :aRevenue AND Company LIKE :safeterm; LIMIT 20 ]; } } A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling getFetchteadList when certain criteria are met. Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security?

Annotate the Apex method with AuraEnabled (Cacheable true). Implement the with sharing keyword in the class declaration. Use the WITH SECURITY_ENFORCED clause within the SOQL query.

A company uses an external system to manage its custom account territory assignments. Every quarter, millions of Accounts may be updated In Salesforce with new Owners when the territory assignments are completed in the external system. What is the optimal way to update the Accounts from the external system?

Apex Rest Web Service

As part of point-to-point integration, a developer must call an external web service which, due to high demand, takes a long time to provide a response. As part of the request, the developer must collect key inputs from the end user before making the callout. Which two elements should the developer use to implement these business requirements?

Apex method that returns a Continuation object LWC

A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions. WHen a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information. Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message. What is the optimal way to automation this?

Apex trigger

An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved. What is the optimal way to implement this?

Apex triggers on Contact and Account that call a helper class to normalize the address.

WHen the sales team views an individual customer record they need to see recent interactions for the customer. These interactions can be sales orders, phone calls or Cases. The date range for recent interactions will be different for every customer record type. How can this be accomplished?

Use Lightning Flow to read the customer's record type, and then do a dynamic query for recent interactions and display on the View page.

Refer to the code below: List<Opportunity> opportunities = [SELECT Id, Amount FROM Opportunity]; for(Opportunity opp: opportunities){ // perform operation here } When the code runs, it results in a System Limit Exception with the error message: Apex heap size too large. What should be done to fix the error?

Use Limits.getLimitHeapSize();

An Apex class does not achieve expected code coverage. The test Setup method explicitly calls a method in the Apex class. How can the developer generate the code coverage?

Call the Apex class method from a testMethod instead of the testSetup method.

Which two scenarios require an Apex method to be called imperatively from a Lightning web component? Choose 2 answers

Calling a method that is not annotated with cacheable=true Calling a method with the click of a button

Which use can can be performed only by using asynchronous Apex?

Calling a web service from an Apex trigger

Given the code above, which two changes need to be made in the Apex Controller for the code to work?

Change the argument in the Apex Controller line 05 from JSONObject to string. Remove line 06 from the Apex Controller and instead use firstName in the return on line 07.

A developer writes a LWC that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component. What should the developer do to determine which objects to include in the response?

Check the isCustom() value on the sObject describe result.

A developer created a Lightning web component that uses a lightning-record-edit-form to collect information about Leads. Users complain that they only see one error message at a time about their input when trying to save a Lead record. Which best practice should the developer use to perform the validations on more than one field, thus allowing more than one error message to be displayed simultaneously?

Client-side validation

A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially. How should the developer write this Apex code without running into governor limits and system limitations?

Use Queueable Apex to chain the jobs to run.

Ursa Major Solar has a custom object, Service Job_e, with an optional Lookup field to Account called Partner_Service_Provider_c. The Totaljobs_c field on Account tracks the total number of ServiceJob_c 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?

Create an Apex trigger on ServiceJob_c

A dev is tasked with creating an application-centric feature on which end-users can access and update information. This feature must be available in Lightning Experience while working seamlessly in multiple device form factors, such as desktops, phone and tablets. Additionally, the feature must support Addressable URL Tabs and interact with the Salesforce Console APIs. What are 2 approaches a dev can take to build the application and support the business requirements?

Create the application using LWC wrapped in Aura Components Create the application using Aura Components

A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail. What is the optimal way for a developer to fix the issue?

Create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there.

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 updated. data @wire(recordList, {recirdID: `$recordId`}) records(result){ if(result.data){ this.data = result.data } else if(result.error){ this.showToast(result.error) } } What should the developer change in the code above for this to happen?

Create a variable to store the result and call refresh(Apex)

A developer notices the execution of all the test methods in a class takes a long time to run, due to the initial setup of all the test data that is needed to perform the tests. What should the developer do to speed up test execution?

Define a method that creates test data and annotate with test setup.

A developer is writing a Visualforce page that queries accounts in the system and presents a data table with the results. The users want to be able to filter the results based on up to five fields. However, the users want to pick the five fields to use as filter fields when they run the page. Which Apex code feature is required to facilitate this solution?

Dynamic variable binding

A dev created a class that implements the Queueable Interface as follows: public class without sharing OrderQueueableJob implements Queueable{ public void execute(QueueableContext context){ // logic System.enqueueJob(New OrderQueueableJob)); } } As part of the deployment process, the dev is asked to create a corresponding test class. Which two actions should the dev take to successfully execute the test class?

Enclose System.enqueuJob(new OrderQueueableJob) within Test.startTest() and Test.stopTest() Ensure the running user of the test class has, at least, View All permissions on the Order object.

A developer has a test class that creates test data before making a mock callout but now receives a 'You have uncommitted work pending. Please commit or rollback before calling out' error. Which step should be taken to resolve the error?

Ensure the records are inserted before the Test.startest() statement and the mock callout occurs after the Test.startTest().

A company uses their own custom-built enterprise resource planning (ERP) system to handle order management. The company wants Sales Reps to know the status of orders so that if a customer calls to ask about their shipment, the Sales Rep can advise the customer about the order's status and tracking number if it has shipped. Which two methods can make this ERP order data visible in Salesforce?

Have the ERP system push the data into Salesforce using the SOAP API. Use Salesforce Connect to view real-time Order data in the ERP system.

Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-bystep wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERP_Numero__c, that is then used in a query to find matching Accounts. ErpNumber = erpNumber + '%'; List <Account> accounts = (SELECT Id, Name FROM Account WHERE ERP_Number_c LIKE :erplumber] A developer receives the exception 'SOQL query not selective enough'. Which step should be taken to resolve the issue?

Mark the ERP_Number_c field as an external ID.

Just prior to a new deployment the Salesforce administrator, who configured a new order fulfilment process feature in a developer sandbox,suddenly left the company. As part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them; making the Order fulfilment feature ready for its go-live in the production environment. Unfortunately, although a Change Set was started, it was not completed by the former administrator. A developer is brought in to finish the deployment. What should the developer do to identify the configuration changes that need to be moved into production?

Leverage the Setup Audit Trail to review the changes made by the departed Administrator and identify which changes should be added to the Change Set.

A developer creates an application event that has triggered an infinite loop. What may have caused this problem?

The event is fired from a custom renderer.

An environment has 2 Apex triggers: an after update trigger on Account and an after update trigger on Contact. The Account after update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after update trigger fires on every edit and it updates every Campaign Member record related to the Contact with the Contact's State. Consider the following: A mass update of 200 Account records addresses, where each Account has 50 COntacts. Each Contact has one Campaign Member. This means there are 10000 COntact records across the Accounts and 10000 Campaign Member reocrds across the Contacts. What will happen when the mass update occurs?

The mass update will fail, since the two triggers fire in the same context, thus exceeding the number of records processed by DML Statements.

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-user. Which three considerations must the developer implement to make the fetchopportunities method available within the Lightning web component?

The method must specify the (cacheable=true) attribute The method cannot mutate the result set retrieved from the database. The method must be annotated with the invocableMethod annotation

Universal Containers decided to use Salesforce to manage a new hire interview process. A custom object called Candidate was created with organization wide defaults set to Private. A lookup on Candidate object sets an employee as an Interviewer. What should be used to automatically give Read access to the record when the lookup field is set to the Interviewer user?

The record can be shared using an Apex class.

A developer has a Visualforce page that automatically assigns ownership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails. What can cause this problem?

The test class does not retrieve the updated value from the database.

A dev wrote a trigger on Opportunity that will update a custom Last Sold Date field on the Opportunity's Account whenever an Opportunity is Closed. In the test class for the trigger, the assertion to validate the Last Sold Date field fails. What might be causing the failed assertion?

The test class has not re-quired the Account record after updating the Opportunity.

A developer created the following test method: @isTest(SeeAllData=true) public static void testDeleteTrigger(){ } The developer org has 5 Accounts where the name starts with "Test". The developer executes this test in the Dev Console. After the test code runs, which statement is true?

There will be no accounts where the name starts with "Test"

A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially How should the developer write this Apex code without running into governor limits and system limitations?

Use Queueable apex to chain the jobs to run sequentially.

A company uses Opportunities to track sales to their customers and their org has millions of Opportunities. They want to begin to track revenue over time through a related Revenue object. As part of their initial implementation, they want to perform a one-time seeding of their data by automatically creating and populating Revenue records for Opportunities, based on complex logic. They estimate that roughly 100,000 Opportunities will have Revenue records created and populated. What is the optimal way to automate this?

Use Database.executeBatch() to invoke a Database. Batchable class.

A developer wrote a class named AccountHistoryManager that relies on field history tracking. The class has a static method called getAccountHistory that takes in an Account as a parameter and returns a list of associated account History object records. The following test fails: @isTest public static void testAccountHistory(){ Account a = new Account(Name = 'test') insert a; a.name = a.name + '1'; List<accountHistory> ahlist = AccountHistoryManager.getAccountHistoray(a); System.Assert(ahlist.size() > 0); } What should be done to make this test pass?

Use Test.isRunningTest in getAccountHistory to conditionally return fake accountHistory records. ???

A business process requires sending new Account records to an external system. The Account Name, Id, CreatedDate, and CreatedById must be passed to the external system in near real-time when an Account is inserted without error. How should a developer achieve this?

Use a Process Builder that calls an @InvocableMethod method.

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user. The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded". What step should the developer take to resolve this issue?

Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records displayed at a time.

A dev created an opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opp to be considered high value is an amount greater than or equal to 41,000,000. However this criteria value can change over time. There is a new requirement to also display high value opportunities in a LWC. Which two actions should the dev take to prevent the business logic that obtains the high value opportunites from being repeated in more than one place?

Use custom metadata to hold the high value amount. Create a helper class that fetches the high value opportunities.

A developer recently released functionality to production that performs complex commission calculations in Apex code called from an Opportunity trigger. Users report that the calculations seem incorrect because the values they see for commissions are wrong. The developer has a representative test data in their developer sandbox. Which three tools or techniques should the developer use to execute the code and pause it at key lines to visually inspect values of various Apex variables?

Visual Studio Code Apex Replay Debugger Developer Console

Refer to the code snippet below: public static void updateCreditMemo (String customer Id, Decimal new Amount) { List<Credit_Memo__c> toUpdate = new List <Credit_Memo__c>(); for (Credit_Memo__c creditMemo: [Select Id, Name, Amount_c FROM Credit Memec WHERE Customer Id LIMIT 50]) { credstMemo. Amount_c= new Amount; toUpdate.add(creditMemo); } Database.update (toUpdate, false); } A custom object called Credit_Memo__c exists in a Salesforce environment. As part of a new feature development that retrieves and manipulates this type of record, the developer needs to ensure race conditions are prevented when a set of records are modified w Apex transaction. In the preceding Apex code, how can the developer alter the query statement to use SOQL features to prevent race conditions within a transaction?

[Select Id, Name, Amount_c FROM Credit_Memo__c WHERE customer_id_c =: customerId LIMIT 50 FOR UPDATE]

A dev has a Batch Apex process, Batch_AccountSales that updates the sales amount for 10,000 Accounts on a nightly basis. The Batch Apex works as designed in the sandbox, however the dev cannot get code coverage on the Batch Apex Class. The test class is below: @isTest private Batch_Account_Update_Pest(){ // some code here not included } What is causing the code coverage problem?

he executeBatch must fall within Test.startTest() and Test.stopTest()

Consider the following code snippet, depicting an Aura component: <aura:component> <lightning:input type="Text" name="searchString" aura:id="search1" label="Search String"/> <br/> <lightning-button label="Search" onclick="{!c.PerformSearch}"/> </aura:component> Which two interfaces can the dev implement to make the component available as a quick action?

force:lightningQuickAction force:lightningQuickAction without Header

A Developer is asked to look into an issue where a scheduled Apex is running into DML Limits. Upon investigation, the developer finds that the number of records processed by the schedule Apex has recently increased to more than 10000. What should the developer do to eliminate the limit exception error?

implement the Batchable interface

A developer created a JS library that simplifies the development of repetitive tasks and features and uploaded the library as a static resource in Salesforce. Another dev is coding new LWC and wants to leverage the Library. Which statement properly loads the static resource within the LWC

import jsutilities from '@salesforce/resourceUrl/jsUtils'

A dev is tasked with creating a LWC that is responsive on various devices. Which two components should help accomplish this goal?

lightning-layout-item lightning-layout

When calling a RESTful web server, the developer must implement two-way SSL authentication to enhance security. The Salesforce admin has generates a self-signed certificate within Salesforce with a unique name of "ERPSecCertificate". Consider the following code snippet: HttpRequest req = new HttpRequest(); // rest of request Which method must the developer implement in order to sign the HTTP request with the certificate?

req.setClientCertificateName('ERPSecCertificate');

Which technique can run custom logic when a LWC is loaded?

use the connectedCallback() method


संबंधित स्टडी सेट्स

Interactive Quiz: 7. System Hacking

View Set

Sport and Exercise Psychology Exam 2

View Set

MENTAL HEALTH: CHAPTER 14: ANXIETY & ANXIETY DISORDERS:

View Set

Chapter 1 Network Defense Fundamentals

View Set