Blog – Salesforce Journal

Hey There! My name is Kenny.

I want to welcome you to my blog where I share my Development journal. I share insight which I gain while I am in the development projects. The development projects are Salesforce, React, Nodejs.

This page contains latest posts that I published

Protected: PD II – 5

Platform Dev II - 5

1 / 53

A Salesforce org has more than 50,000 contacts. A new business process requires a calculation that aggregates data from all of these contact records. This calculation needs to run once a day after business hours.

Which 2 steps should a developer take to accomplish this? Choose 2 answers

2 / 53

A developer sees test failures in the sandbox but not in the Production. No code or metadata chanqes have been activvely made to either environment since the sandbox was created. Which consideration should be checked to resolve the issue?

3 / 53

A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for
certain 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.

Depending on company personnel resources, what are two ways to
automate this?

4 / 53

Consider the following code snippet:

<apex:page docType="html=5.0" controller="FindOpportunities">	<apex:form>		<apex:pageBlock>			<apex:pageBlockSection title="Find Opportunity">				<apex:input label="Opportunity name" />				<apex:commandButton value="search" action="{!search}" />			</apex:pageBlockSection>			<apex:pageBlockSection>				<!--Data Table -->			</apex:pageBlockSection>		</apex:pageBlock>	</apex:form></apex:page>

Users of this Visualforce page complain that the page does a full refresh every time the search button is pressed.
What should the developer do to ensure that a partial refresh is made so that only the section identifie with OpportunityList is redrawn on the screen?

5 / 53

Universal containers needs to integrate with several external systems. The process is initiated when a record is created in Salesforce. The remote systems do not require Salesforce to wait for a response before continuing.

What is the recommended best solution to accomplish this?

6 / 53

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 code feature is required to facilitate this solution?

7 / 53

AW Computing (AWC) handles orders in Salesforce and stores its product inventory in a field, Inventory__c, on a custom object, Product__c.ย  When an order for a Product__c is placed, the Inventory__c field is reduced by the quantity of the order using an Apex trigger.

public void reduceInventory(Id prodId, Integer qty) {	Integer newInventoryAmt = getNewInventoryAmt(prodId, qty);	Product__c p = new Product__c(Id=prodId, Inventory__c= newInventoryAmt);	update p;	//code goes here}

AWC wants the real-time inventory reduction for a product to be sent to many of its external systems, including some future systems the company is currently planning.

What should a developer add to the code at the placeholder to meet these requirements?

8 / 53

A developer vs creating a Lightning web component to display a calendar. The component wilt be used in multiple
countries. In some locales, the first day of the week is a Monday. or a Saturday, or a Sunday.
What should the developer do to ensure the calendar displays accurately for users in every locale?

9 / 53

A developer wrote the following method to find all the test accounts in the org:

public static account[] searchTestAccounts() {	List<List<sObject>> searchList = [FIND 'test' IN ALL FIELDS RETURNING Account(Name)];	return (Account[]) searchList[0];}

However, the test method below fails:

@isTestpublic static void testSearchTestAccouunts() {	Account a = new Account(name='test');	insert a;	Account[] accounts = TestAccountFinder.searchTestAccounts();	System.assert(accounts.size() == 1);}

What should be used to fix this failing test?

10 / 53

Consider the following snippet:

<apex:page docType="html-5.0" controller="FindOpportunities">	<apex:form>		<apex:pageBlock>			<apex:pageBlockSection title="find Opportunity">				<apex:input label="Opportunity name" />				<apex:commandButton value="search" action="{!search}" />			</apex:pageBlockSection>			<apex:pageBlockSection>				<!-- DATA Table -->			</apex:pageBlockSection>		</apex:pageBlock>	</apex:form></apex:page>

Users of this Visualforce page complain that the page does a full refresh every time the Search button is pressed.
what should the developer do to ensure that a partial refresh is made so that only the section identified with
is re-drawn on the screen?

11 / 53

A developer created an Apex class that updates an Account based on input from a Lightning web component that is used to register an Account. The update to the Account should only be made if it has not already been registered,

account = [SELECT Id, Is_Registered__c FROM Account WHERE Id =: accountId];if(!account.Is_Registered__c) {	account.Is_Registered = true;	//set other account fields	update account;}

What should the developer do to ensure that users do not overwrite each other's updates to the same Account if they make updates at the same time?

12 / 53

A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products.

A developer received these requirements:

  • Whenever a product is created or updated in the PIM, a product must be created or updated as a Product2 record in Salesforce, and a PriebookEntry record must be created or updated automatically by Salesforce.
  • The PricebookEntry should be created in a Pricebook2 that is specified in a Custom Setting.

What should the developer use to satisfy these requirements?

13 / 53

Containers want to notify an external system if an unhandled exception occurs when their nightly Apex batch Job runs.
What is the appropriate publish/subscribe logic to meet this requirement?

14 / 53

A developer used custom settings to store some configuration data that changes occasionally. However, tests are now falling in some of the sandboxes that were recently refreshed.

What should be done to eliminate this issue going forward?

15 / 53

A software company uses a custom object, Defect__c, to track defects in their software. Defect__c has organization-wide defaults set to private. Each Defect__c has a related list of Reviewer__c records, each with a lookup field to User that is used to indicate that the User will review the Defect__c.
What should be used to give the User on the Reviewer__c record read only access to the Defect__c record on the Reviewer__c record?

16 / 53

Consider the following code snippet:

HttpRequest req = new HttpRequest();req.setEndpoint('https://testEndpoint.example.com');req.setMethod('GET');Blob headerValue = Blob.valueOf('myUsername' + 'strongPassword');String authorizationHeader = 'BASIC' +EncodingUtil.base64Encode(headerValue);req.setHeader('Authorization', authorizationHeader);Http http = new Http();HttpResponse res = http.send(req);

Which 2 steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify the code? Choose 2 answers

17 / 53

A business requires that every parent record must have A child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.
A validation rule blocks child record from being created. The method uses a try/catch block to handle the DML exception.
What should the developer do to ensure the parent always has a child record?

18 / 53

A developer asked to replace the standard Case creation screen with a custom screen that takes users through before creating the
Case. The org only has users running Lightning experience.

What should the developer override the Case New Action with to satisfy the requirements?

19 / 53

universal Containers (UC) has custom Order and Order line objects that represent placed by its customers.

A developer has new requirement that UC's external enterprise resource planning (ERP) system must be able to integrate With Salesforce to create orders for existing customers tn Salesforce whenever an order is placed in the ERP system.

What should the developer use to create the orders in Salesforce?

20 / 53

A developer is creating a Lightning web component that contains a child component. The property is being
passed from the parent to the child. The public property is changing, but the functon is not being invoked.

@api stage;opps;connectedCallback() {	this.opps = this.setOppList(this.stage);}

What should the developer change to allow this?

21 / 53

Refer to the component ode and requirements below:

<lightning:layout multipleRows="true">	<lightning:layoutItem size="12">		{!v.account.Name}	</lightning:layoutItem>	<lightning:layoutItem size="12">		{!v.account.AccountNumber}	</lightning:layoutItem>	<lightning:layoutItem size="12">		{!v.account.Industry}	</lightning:layoutItem></lightning:layout>

Requirements:
1. For mobile devices, the information should display in three rows
2. For desktop and tables, the information should display in a single row.

Requirement 2 is not displaying as desired.

22 / 53

The Account object has a field, audit_Code__c, that is used to specify what type of auditing the Account needs and a Lookup to User, Auditor_c, that is the assigned auditor.
When an Account is initially created, the user specifies the Audit_Code__c. Each User in the org has a unique text field, Auditor__c.
that is used to automatically assign the correct user to the Account's Auditor__c field.

trigger AccountTrigger on Account(before insert) {	AuditAssigner.setAuditor(Trigger.New);}public class AuditAssigner {	public static void setAuditor() {		for(User u: [SELECT Id, Audit_Code__c FROM User]) {			for(Account a: accounts) {				if(u.Audit_Code__c == a.Audit_Code__c) {					a.Auditor__c = u.Id;				}			}		}	}}

What should be changed to optimize the code efficiency? Choose 2 answers

 

23 / 53

A Developer created the code below to perform an HTTP GET request to an external system.

public class ERPCatalog {	private final ERP_CATALOG_URL = 'http://sampleCatalog.com/cat';	public String getERPCatalogContents() {		Http h = new Http();		HttpRequest req = new HttpRequest();		req.setEndpoint(ERP_CATALOG_URL);		req.setMethod('GET');		HttpResponse res = h.send(req);		return res.getBody();	}}

when the code is executed, the callout is unsuccessful and the following error appears within the Developer Console: System.CalloutException: Unauthorized endpoint

Which recommended approach the developer implement to resolve the callout exception?

24 / 53

An org has a Process Builder process on Opportunity that sets a custom field, CommissionBaseAmount__c, when an Opportunty is edited and the Opportunity's Amount changes.

A developer recently deployed an Opportunity before update trigger that uses the CommissionBaseAmount__x and complex logic to calculate a value for a custom field, CommissionAmount__c, when an Opportunity stage changes to Closed/Won.

users report that when they change the Opportunity to Closed/Won and also change the Amount during the same save. the CommissionAmount__c is tncorrect.

Which two actions should the developer take to correct this problem?
Choose 2 answers

25 / 53

As part of custom development, a developer creates a lightning component to show how a particular opportunity progresses over time. The component must display the date stamp when any of the following fields change:

  • Amount, Probability, Stage or Close date

How should the developer access the data that must be displayed?

26 / 53

public class SearchFeature {   public static List<List<sObject>> searchRecords(String searchQuery) {      return [FIND searchQuery IN ALL FIELDS RETURNING Account, Opportunity, Lead];   }}

A developer created the following test class to provide the proper code coverage for the snippet above:

@isTestprivate class SearchFeature_Test {	@TestSetup	private static void makeData() {		//insert Opportunities, accounts, and lead	}	@isTest	private static searchRecords_Test() {		List<List<sObject>> records = searchFeature.searchRecords('Test');		System.assertNotEquals(records.size(), 0);	}}

However, when the test runs no data is returned and the assertion fails.

Which edit should the developer make to ensure the test class runs successfully?

27 / 53

Consider the following code:

<c-selected-order>	<template for:each={orders.data} for:item="order">		<c-order orderId={order.Id}></c-order>	</template></c-selected-order>

How should the <c-order> component communicate to the <c-selected-order> component that an order has been selected by the user?

28 / 53

Users upload a csv files in an external system to create account and contact records in Salesforce. Up to 200 records can be created at a time. The users need to wait for a response from Salesforce in the External system, but the data does not need to synchronize between the 2 systems.

Based on these requirements, which method should a developer use to create the records in Salesforce?

 

29 / 53

Refer to the Lightning component below:

<lightning:button label="Save" onclick="{!c.handleSave}" />({	handleSave: function(component, event, helper) {		helper.saveAndRedirect(component);	}})

The Lightning Component allows users to click a button to save their changes and then 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

30 / 53

Given the following information regarding Universal Containers (UC):

  • UC represents their customers as Accounts in Salesforce
  • All customer has a unique Customer-Number- c, that is unique across all of UC's systems.
  • UC also has a custom Invoice_ c object, with a Lookup to Account, to represent invokes that are sent out from their external system

UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time.

What is the optimal way to implement this?

31 / 53

A developer has created a LWC that uses the getRecord wire adapter.
Which three things should the developer do in the test to validate the wire method is working as expected?

32 / 53

A business currently has a process to manually upload orders from its external Order Management System(OMS) into Salesforce,

This is a labor-intensive process since accounts must be exported out of SAlesforce the Ids. The upload file must be updated with the correct account IDs to relate the orders to the corresponding accounts.

Which 2 recommendations should make this process more efficient? Choose 2 answers

33 / 53

Get Cloudy Consulting (GCC) has a multitude of servers that host its customers' websites. GCC wants to provide a server status page that is always on display in its call center. It should update in real-time with any changes made to any servers. To accommodate this on the server side. a developer created a Server Update platform event.
The developer is on the Lightning web component to display the information.

What should be added to the Lightning web component to allow the developer to interact with the Server Update platform event?

34 / 53

A business currently has a process to manually upload orders from its external Order Management (OMS) into Salesforce.
This is a labor-intensive process since accounts must be exported out of Salesforce to get the IDs. the upload file must be updated with the
correct account IDs to relate the orders to the corresponding accounts.

Which two recommendations should make this process more efficient? Choose 2 answers

35 / 53

A company represents its 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?

36 / 53

How can a developer efficiently incorporate multiple JavaScript libraries in an Aura component?

37 / 53

As part of a new integration, a developer is asked to implement a new custom search functionality that is capable
of performing unrestricted queries and can account for all values wthin a custom picklist field, on the
Opportunity object. The search feature must also account for NULL values.
The organizaton-wide default for the Ooportunity object IS set to Public Read-Only, and a new custom Index has been created for the type field. There are more than 5 million Opportunity records within the environment, and a considerable amount of the existing records have NULL values for the picklist.
Which technuque should the developer Implement to maximize performance when querying NULL values?

38 / 53

An end user reports that a Lightning component is performing poorly. Which two steps should be taken in production to investigate?
Choose 2 answers

39 / 53

Universal Containers (UC) has an CRP system that stores customer information.

When an Account is created in Salesforce, the FRP system's REST endpoint for creating new customers must automatically be called with the Account information, If the call to the ERP system fails, the Account should still be created. Accounts in UC org are only created, one at a time, by users in the customer on-boarding department.

What should a developer to make the call to the CRP system's REST endpoint?

40 / 53

Given the following code:

for(Contact c: [SELECT Id, LastName FROM Contact WHERE CreatedDate = TODAY]) {	Account a = [SELECT Id, Name FROM Account WHERE CreatedDate = TODAY LIMI 9];	c.AccountId = a.Id;	update c;}

Assuming there were 10 contacts and 5 accounts created today. What is the expected result?

41 / 53

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

42 / 53

Universal Containers needs to integrate With an external system. The process iS initiated when a record is created in Salesforce. The remote system does not require Salesforce to wait for resoonse before continuing.
What should the developer use to accomplish this

43 / 53

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?

44 / 53

The following code is called from a trigger handler class from the Opportunity trigger:

for(Opportunity opp: Trigger.New) {	if(opp.Amount >= 1000000) {		Account acct = [SELECT Id, Status FROM Account WHERE Id = :opp.accountId LIMIT 1];		acct.status = 'High Essential';		update acct;	}}

Which two changes should improve this code and make it more efficient

45 / 53

As part of a custom interface, a developer team creates various new LWC, Each of the components handles errors using toast messages. When the development is complete, all the components are added to the same Lightning page.

During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components.

Which 2 techniques should the developer implement to improve the user experience? Choose 2 answers

46 / 53

A developer is working with existing functionality that tracks how many times a stage has changed for an Opportunity. When the Opportunity's stage is changed, a workflow rule is fired to increase the value of a field by one. The developer wrote an after trigger to create a child record when the field changes from 4 to 5.
A user changes the stage of an Opportunity and manually sets the count field to 4. The count field updates to 5, but the child record is not created.
What is the reason this is happening?

47 / 53

Consider the following code snippets:

public class searchFeature {	public static List<List<sObject>> searchRecords(String searchQuery) {		return [FIND searchQuery IN ALL FIELDS RETURNING Account, Opportunity, Lead];	}}

A developer creating a test class below to cover the test coverage:

@isTestprivate class searchFeature_Test {	@TestSetup	private static void makeData() {		//insert opp, accounts, and lead	}	@isTest	private static searchRecords_Test() {		List<List<sObject>> records = searchFeature.searchRecords('Test');		System.assertNotEqual(records.size(), 0);	}}

However, when the test runs, no data is returned and the assertion fails. Which edit should the developer make to ensure the test class runs successfully?

48 / 53

Universal Container requested the addition of a third-party Map widget to an existing LWC.
Which 2 actions should the developer take to implement this requirement? Choose 2

49 / 53

Consider the following snippet:

public static List<Account> getAccounts(Date thisDate, Id goldenRT) {	List<Account> accountList = [SELECT Id, Name, Industry FROM Account WHERE CreatedDate = :thisDate OR recordTypeId = :goldenRT];	return accountList;}

The apex method is executed with a large data volume count for Accounts and the query is performing poorly.

Which technique should the developer implement to ensure the query perform optimally while preserving the entire result set?

50 / 53

developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The apex method, getRecentContacts, returns a list of Contacts and will be wired to a property in the component.

public class ContactFetcher {	static List<Contact> getRecentContacts(Id accountId) {		List<Contact> contacts = getFiveMostRecent(accountId);		return contacts;	}	private static List<Contact> getFiveMostRecent(Id accountId) {		//implementation	}}

Which two lines must change in the above code to make the Apex method able to be wired? Choose 2 answers

51 / 53

A developer is tasked with creating LWC that allows users to create a case for a selected product, directly from a custom lightning page. The input fields in the component are displayed in a non-linear fashion on top of an image of the product to help the user better understand the meaning of the fields.

Which 2 components should the developer use to implement the creation of the case from the LWC?

 

52 / 53

A developer wrote an Apex method that makes an HTTP callout to external system to get specialized data when a button is clicked from a custom LWC on the Account record page

Recently users have complained that it takes longer than desired for the data to appear on the page after clicking the button.

What should the developer use to troubleshoot this issue?

 

53 / 53

Which annotation should a developer use on an Apex method to make it available to be wired to a property in a Lightning Web Component?

Your score is

The average score is 81%

0%

<!– AddThis Share Buttons generic…
Read More

Protected: PD II – 4

Platform Dev II - 4

1 / 52

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

2 / 52

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?

3 / 52

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?

4 / 52

Universal Containers needs to integrate with several external systems. The process is initiated when a record is created in Salesforce.
The remote systems do not require Salesforce to wait for a response before continuing.
What is the recommended best solution to accomplish this?

5 / 52

A developer writes a Lightning web component 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?

6 / 52

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.
What should the developer ensure to correct these errors?

7 / 52

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.
What is the optimal way to implement these requirements?

8 / 52

Refer to the test method below:

@isTeststatic void testAccountUpdate() {    Account acct = new Account(Name = 'Test');    acct.Integration Updated_c = false;    insert acct;}CalloutUtil.sendAccountUpdate(acct.Id);Account acctAfter = [SELECT Id, Integration_Updated__c FROM Account WHERE Id =: acct.Id][0];System.assert(true, acctAfter.Integration_Updated__c);

The test method calls a web service that updates an external system with Account information and sets the Account's Integration Updated_c checkbox to True when it completes.
The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts."
What is the optimal way to fix this?

9 / 52

@isTeststatic void testupdateSuccess() {    Account acct = new Account(Name = 'test');    insert acct;    // Add code here     extension.inputValue = 'test';    PageReference pageRef = extension.update();    System.assertNotEquals(null, pageRef);}

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

10 / 52

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

11 / 52

Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs. What is the appropriate publish/subscribe logic to meet this requirement?

12 / 52

Refer to the Aura component below:

//component<aura: component> <aura:attribute name="contactInfo" type="object"/> <aura:attribute name="showContact Info" type="boolean" default="true"/> <aura:handler name="init" value="{!this)" action="{!c.init}"/>     <!-- ... other code .... -->     <aura:if isTrue="{!v.showContact Info}">     <c:contact Info value="{!v.contactInfo)"/>     </aura:if> </aura:component> //jsinit: function (cmp, helper) {     // ...other code ...     var show helper.getShowContactInfo();     cmp.set("v.showContactInfo", show);     init: function (cmp, helper) {     },     //...other code ...     var show = helper.getShowContactInfo();     cmp.set("v.showContactInfo", show);     // other code... })

A developer receives complaints that the component loads slowly.
Which change can the developer implement to make the component perform faster?

13 / 52

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records

public void updateAndMakeCallout(Map < Id, Request_c > regs, Map < Id, Request_Line_c > reqLines) {    Savepoint sp = Database.setSavepoint();    try {        insert reqs.values();        insert reqLines.values();        HttpResponse response = CalloutUtil.makeRestCallout(reqs.keySet(), reqLines.keySet());    } catch (Exception e) {        Database.rollback(sp);        System.debug(e);    }}

The calloutUtil.makeRestCallout fails with a 'You have uncommitted work pending. Please commit or rollback before calling out' error. What should be done to address the problem?

 

14 / 52

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?

15 / 52

Consider the controller code below that is called from an Aura component and returns data wrapped in a class.

public class myserversideController {     @AuraEnabled     public static MyDataWrapper getsomeData( String theType) {         Some_Object_c someobj = [              SELECT ID, Name             FROM Some_Object_c             WHERE Type_c = : theType             LIMIT 1        ];            Another_Object_o anotherobj = [             SELECT ID, Option_c             FROM Another_Object_c             WHERE Some_Object_c = :someObj.Name             LIMIT 1         ];         MyDataWrapper theData = new MyDataWrapper();         theData.Name = someObj.Name;         theData.Option = anotherobj.Option_c;         return theData;     }    public class MyDataWrapper {         public string Name { get; set; }         public string option { get; set; }         public MyDatawrapper () { }    }}

The developer verified that the queries return a single record each and there is error handling in the Aura component, but the component is not getting anything back when calling the controller getsomeData().
What is wrong?

 

16 / 52

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?

17 / 52

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 scheduled Apex has recently increased to more than 10,000.
What should the developer do to eliminate the limit exception error?

18 / 52

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.
What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?

19 / 52

Universal Containers (UC) has an ERP system that stores customer information.

When an Account is created in Salesforce, the ERP system's REST endpoint for creating new customers must automatically be called with the Account information. If the call to the ERP system fails, the Account should still be created. Accounts in the UC org are only created, one at a time, by users in the UC customer onboarding department.

What should a developer implement to make the call to the ERP system's REST endpoint?

20 / 52

A company has a custom object, Order_c, that has a custom picklist field, Status_c, with values of 'New,' 'In Progress,' or 'Fulfilled' and a lookup field, Contact_c, to Contact.
Which SOQL query will return a unique list of all the Contact records that have no 'Fulfilled' Orders?

21 / 52

A software company uses a custom object, Defect__c, to track defects in their software. Defect__c has organization-wide defaults set to private. Each Defect__c has a related list of Reviewer__c records, each with a lookup field to User that is used to indicate that the User will review the Defect__c.

What should be used to give the User on the Reviewer_c record read only access to the Defect_c record on the Reviewer c record?

22 / 52

A developer created the code below to perform an HTTP GET request to an external system.

public class ERPCatalog {    private final ERP CATALOG_URL = 'http//samplecatalog.com/cat';     public string getERFCatalogContents() {         Http h = new Http();         HttpRequest req= new HttpRequest();         req.setEndpoint (ERP CATALOG_URL);         req.setMethod('GET');         HttpResponse res = h.send (req);         return res.getBody();     } }

When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console:

System.CalloutException: Unauthorized endpoint

Which recommended approach should the developer implement to resolve the callout exception?

23 / 52

A developer created a class that implements the Queueable Interface, as follows:

public class without sharing orderQueueableJob implements Queueable {     public void execute (queueableContext context) {     // implementation logic     System.enqueueJob (new FollowupJob ());     } }

As part of the deployment process, the developer is asked to create a corresponding test class.ย Which two actions should the developer take to successfully execute the test class?ย 

Choose 2 answersย 

24 / 52

Consider the following code snippet:

<apex:page docType="html-5.0" controller="FindOpportunities">     <apex: form >         <apex:pageBlock >             <apex:pageBlocksection title="find opportunity">             <apex:input label="opportunity name"/>             <apex:commandButton value="search" action="(!search}" />             </apex:pageBlockSection>             <apex:pageBlocksection title="opportunity List" id="opportunityList">             <!-- DATA Table -->             </apex:pageBlockSection>         </apex:pageBlock>     </apex: form> </apex:page>

Users of this Visualforce page complain that the page does a full refresh every time the Search button is pressed.ย 

What should the developer do to ensure that a partial refresh is made so that only the section identified with opportunityList is re-drawn on the screen?

25 / 52

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?

26 / 52

A developer is building a Lightning web component that searches for Contacts. The component must communicate the search results to other unrelated Lightning web components, that are in different DOM trees, when the search completes. What should the developer do to implement the communication?

27 / 52

In an organization that has multi-currency enabled, a developer is tasked with building a Lighting component that displays the top ten Opportunities most recently accessed by the logged in user. The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.
What is the most effective approach to ensure values displayed respect the user's locale settings?

28 / 52

An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records are loaded, the Apex trigger creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
What is the most extendable way to update the Apex trigger to accomplish this?

29 / 52

A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes.

The solution must scale to allow for 10,000 emails per day.

The criteria to send the email should be evaluated after certain conditions are met. What is the optimal way to accomplish this?

30 / 52

Which technique can run custom logic when a Lightning web component is loaded?

31 / 52

Consider the following code snippet:

public static List<Account> getAccounts (Date thisDate, Id goldenRT) {     List<Account> accountList = [Select Id, Name, Industry FROM Account WHERE CreatedDate = thisDate     OR RecordTypeId = :goldenRT];     return accountList; }

The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly. Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result

32 / 52

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 the 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?

33 / 52

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?

34 / 52

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?

35 / 52

Consider the Apex class below that defines a RemoteAction used on a Visualforce search page.

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, NumberOfEmployees     FROM Account WHERE Name = :accountName];     return account; }

Which code snippet will assert that the remote action returned the correct Account?

36 / 52

A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.ย  What is the optimal way to achieve this?

37 / 52

A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data correctly in a sandbox environment.
A Salesforce admin with a custom profile attempts to deploy this trigger via a change set into the production environment, but the test class fails with an insufficient privileges error.

What should a developer do to fix the problem?

38 / 52

An Aura component has a section that displays some information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.

<lightning:layout multipleRows="false">     <lightning:layoutItem size="6">{!v.rec.Name}     </lightning:layoutItem>     <lightning: layoutItem size="6">            {!v.rec.Description__c)     </lightning:layoutItem> </lightning: layout>

How should a developer change the component to be responsive for mobile and tablet devices?

39 / 52

A developer has working business logic code, but sees the following error in the test class:
You have uncommitted work pending. Please commit or rollback before calling out.
What is a possible solution?

40 / 52

A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.
Which functionality consideration impacts the final decision?

41 / 52

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?

42 / 52

Refer to the Lightning component below:

<lightning:button label="Save" onclick="{!c.handleSave}" /> ({    handleSave: function (component, event, helper) {     helper.saveAndRedirect (component); }) 

The Lightning Component allows users to click a button to save their changes and then 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

43 / 52

A developer is tasked with creating a Lightning web component that is responsive on various devices.
Which two components should help accomplish this goal?

Choose 2 answers

44 / 52

Consider the queries in the options below and the following information:
For these queries, assume that there are more than 200,000 Account records.
โ€ข These records include soft-deleted records; that is, deleted records that are still in the Recycle Bin.
โ€ข 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?
Choose 2 answers

 

45 / 52

The Account object has a field, Audit_code__c, that is used to specify what type of auditing the Account needs and a Lookup to User, Auditor__c, that is the assigned auditor. When an Account is initially created, the user specifies the Audit_code__c. Each User in the org has a unique text field, Audit_code__c, that is used to automatically assign the correct user to the Account's Auditor__c field.

trigger AccountTrigger on Account(before insert) {    AuditAssigner.setAuditor(Trigger.new);}public class AuditAssigner {    public static void setAuditor(List < Account > accounts) {        for (User u: [SELECT Id, Audit_code_c FROM User]) {            for (Account a: accounts) {                if (u.Audit_Code_c == a.Audit_Code_c) {                    a.Auditor_c = u.Id;                }            }        }    }

What should be changed to most optimize the code's efficiency? Choose 2 answers

46 / 52

Which three actions must be completed in a Lightning web component for a JavaScript file in a static resource to be loaded?
Choose 3 answers

 

47 / 52

Consider the below trigger intended to assign the Account to the manager of the Account's region:

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__c FROM Region__c            WHERE Name =: anAccount.Region_Name__c];            anAccount.OwnerId = the Region.Region_Manager__c;            accountList.add(anAccount);    }    update accountList;}

Which two changes should a developer make in this trigger to adhere to best practices?
Choose 2 answersย 

48 / 52

A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high-value. The current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time. There is a new requirement to also display high-value opportunities in a Lightning web component.
Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high-value opportunities from being repeated in more than one place?
Choose 2 answers

49 / 52

Which scenario requires a developer to use an Apex callout instead of Outbound Messaging?

50 / 52

Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment 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 fulfillment 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?

51 / 52

Refer to the following code snippets:

//MyOpportunities.jsimport LightningElement, api, wire) from 'lwc'; import getopportunities from '@salesforce/apex/opportunitycontroller.findMyopportunities'; <strong>MyOpportunities.js</strong>export default class Myopportunities extends LightningElement (     @api userid;     @wire (getOpportunities, (oppowner: '$userId'})     opportunities; } //OpportunityController.clspublic with sharing class opportunityController { @AuraEnabled public static List<opportunity> findMyOpportunities (Id oppowner) {     return [         SELECT Id, Name, Amount         FROM Opportunity         WHERE OwnerId = :oppowner         WITH SECURITY_ENFORCED         LIMIT 10     ];

A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue?

52 / 52

There are user complaints about slow render times of a custom data table within a Visualforce page that loads thousands of
Account records at once.
What can a developer do to help alleviate such issues?

Your score is

The average score is 79%

0%

<!– AddThis Share Buttons generic…
Read More

Protected: PD II – 3

Platform Dev II - 3

1 / 60

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?ย 

2 / 60

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 AccountHistory object records.ย 

The following test fails

@istest. public static void testAccountHistory(){	Account a = new Account (name='test'); 	insert a; 	a.name = a.name + 'L'; 	update a; 	List<Accountlistory> ahlist = AccountHistoryManager.getAccountHistory(a); 	System.assert (ahlist.size() > 0): }

What should be done to make this test pass?

 

3 / 60

Consider the Apex class below that defines a RemoteAction used on a Visualforce search page.ย 

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, NumberofEmployees FROM Account WHERE Name = :accountName];		return account;	}}

Which code snippet will assert that the remote action returned the correct account?

4 / 60

A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time.ย 

There is a new requirement to also display high value opportunities in a Lightning web component.ย 

Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high value opportunities from being repeated in more than one place?ย 

Choose 2 answersย 

5 / 60

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.ย 

What is the recommended approach to perform validations on more than one field, and display multiple error messages simultaneously with minimal JavaScript intervention?ย 

6 / 60

The Salesforce admin at Cloud Kicks created a custom object called Regien 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?ย 

7 / 60

The Account object has a field, Audit_Code__c. that is used to specify what type of auditing the Account needs and a Lookup to User, Auditor__c, that is the assigned auditor.ย 

When an Account is initially created, the user specifies the Audit_Code__c. Each User in the org has a unique text field, Audit_code__c, that is used to automatically assign the correctย user to the Account's Auditor__c field.ย 

What should be changed to most optimise the code's efficiency? Choose 2 answers

8 / 60

Which three actions must be completed in a Lightning webย component for a JavaScript file in a static resource to be loaded?ย 

Choose 3 answers

9 / 60

There are user complaints about slow render times of a customย data table within a Visualforce page that loads thousands of Account records at once.ย 

What can a developer do to help alleviate such issues?

10 / 60

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 rollbackย to SP3 to continue with the final execution. However, when the rollbackย to SP3 is called, aย runtime error occurs.ย 

Why does the developer receive a runtime error?ย 

11 / 60

Consider the below trigger Intended to assign the Account to the manager of the Account's region:

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__c 			WHERE Name = :anAccount.Region_Name__c		]; 		anAccount.Ownerid = theRegion.Region_Manager__c; 		accountlist.add(anAccount); 		update accountList; }

Which two changes should a developer make in this trigger toย adhere to best practices? Choose 2 answers

12 / 60

Refer to the Lightning component Below:

<lightning:button label="Save" onclick="(!c.handleSave)" /> ({ handleSave: function (component, event, helper) { 		helper.saveAndRedirect(component);    }})

The Lightning Component allows users to click a button to save their changes and then redirect 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 JavaScript?ย Choose 3 answers

13 / 60

A developer creates an application event that has triggered an infinite loop.ย 

What may have caused this problem?ย 

14 / 60

A developer used custom settings to store some configurationย data that changes occasionally. However, tests are now failing inย some of the sandboxes that were recently refreshed.ย 

What should be done to eliminate this issue going forward?

15 / 60

Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users.ย 

Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business.ย 

One of the requirements is to allow certain community users within the same Account hierarchy to see several departments containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.ย 

Which solution solves these requirements?ย 

16 / 60

Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.ย 

What is the appropriate publish/subscribe logic to meet this requirement?

17 / 60

An Aura component has a section that displays some Information about an Account and it works well on the desktop, but users have to scroll horizontally to see the description field output on their mobile devices and tablets.ย 

<lightning:layout multipleRows="false"> 	<lightning:layoutItem size="6">		{!v.rec.Name} 	</lightning:layoutItem> 	<lightning:layoutItem size="6"> 		{!v.rec.Description__c} 	</lightning: layoutItem> </lightning:layout>

How should a developer change the component to be responsive for mobile and tablet devices?ย 

18 / 60

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 the 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?

19 / 60

A developer is creating a Lightning web component that displaysย a list of records in a lightning-datatable.

After saving a newย record to the database, the list is not updating.

@wire (recordList, {recordId: '$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?ย 

20 / 60

Universal Containers needs to integrate with several external systems.

The process is initiated when a record is created in Salesforce.

The remote systems do not require Salesforce to wait for a response before continuing.ย 

What is the recommended best solution to accomplish this?ย 

21 / 60

A developer created a class that Implements the Queueable Interface, as follows:ย 

public class without sharing OrderQueueableJob implements Queueable { 	public void execute (queueablecontext context) {		// implementation logic 		System.enqueue Job (new FollowUpJob()); 	} }

As part of the deployment process, the developer is asked to create a corresponding test class.ย 

Which two actions should the developer take to successfully execute the test class?ย Choose 2 answers

22 / 60

A developer writes a Lightning web component 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?ย 

23 / 60

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?

24 / 60

A large company uses Salesforce across several departments.

Each department has its own Salesforce Administrator.

It was agreed that each Administrator would have their own sandbox In which to test changes.ย 

Recently, users notice that fields that were recently added for one department suddenly disappear without warning.ย 

Which two statements are true regarding these issues and resolutions?ย 

Choose 2 answersย 

25 / 60

Universal Containers (UC) has an ERP system that storesย customer information.ย 

When an Account is created in Salesforce, the ERP system's REST endpoint for creating new customers must automatically be called with the Account Information.

If the call to the ERP system fails, the Account should still be created. Accounts in the UC org are only created, one at a time, by users in the UC customer on-boarding department.ย 

What should a developer implement to make the call to the ERP system's REST endpoint?ย 

26 / 60

An org records customer order information in a custom object, Order 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?

27 / 60

A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.ย 

What should the developer ensure to correct these errors?

28 / 60

Which scenario requires a developer to use an Apex calloutย instead of Outbound Messaging?

29 / 60

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?ย 

30 / 60

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 scheduled Apex has recently increased to more than 10,000.ย 

What should the developer do to eliminate the limit exception error?ย 

31 / 60

A developer is trying to decide between creating a Visualforce component or a Lightning component for a custom screen.ย 

Which functionality consideration Impacts the final decision?

32 / 60

Consider the following code snippet:

<apex:page doctype="html-5.0" controller-"FindOpportunities"> <apex:form>     <apex:pageBlock>         <apex:pageBlockSection title="find opportunity"s Capex:input label-"opportunity name"/>             <apex:commandButton value="search" action="{!search}" />         </apex:pageBlockSection         <apex:pageBlockSection title="Opportunity List" id="opportunityList">             <!-- DATA Table -->         </apex:pageBlockSection>     </apex:pageBlock> </apex:form> </apex:page>

What should the developer do to ensure that a partial refresh is made so that only the section Identified with opportunityListย is re-drawn on the screen?ย 

33 / 60

A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes.

The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met.ย 

What is the optimal way to accomplish this?

34 / 60

A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes.

The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met.ย 

What is the optimal way to accomplish this?ย 

35 / 60

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

36 / 60

A developer wrote a test class that successfully asserts a trigger on Account. It fires and updates data correctly in a sandbox
environment.

A Salesforce admin with a custom profile attempts to deploy a trigger via a change set into the production environment, but the test class falls with an insufficient privileges error.

What should a developer do to fix the problem?

37 / 60

Refer to the Aura component below:ย 

Component markup:

<aura:component>     <aura:attribute name="contactinfo" type="object" />     <aura:attribute name="showContact Info" type-"boolean" default="true"/>     <aura:handler name-"init" value="(this)" action=" (!c.init)"/>     other code     <aura:if isTrue="{!v.showContactInfo":     <:contactInfo value-"!v.contactInfo)"/>     </aura:if> </aura:component>Controller js:init: function(cmp, helper) {   cmp.set("v.showContactInfo", show)}

A developer receives complaints that the component loads slowly. Which change can the developer implement to make the component perform faster?

 

38 / 60

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.ย 

What is the optimal way to implement these requirements?

39 / 60

A company wants to incorporate a third-party web service to set the Address fields when an Account is inserted, if they have not already been set.
What is the optimal way to achieve this?

40 / 60

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

41 / 60

Consider the queries in the options below and the following information:

  • For these queries, assume that there are more than 200,000 Account records.
  • These records include soft-deleted records; deleted records that are still in the Recycle Bin.
  • There are two fields that are marked as External Id on theย Account. These fields are Customer_Number__c and ERP_Key__c

 

Which 2 queries are optimised for large data volumes? Choose 2 answersย 

42 / 60

A company has a custom object, Order_c, that has a custom picklist field, Status_c, with values of 'New,' 'In Progress,' or "Fulfilled' and a lookup field, Contact__c, to Contact.ย 

Which SOQL query will return a unique list of all the Contact records that have no 'Fulfilled' Orders?

43 / 60

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

44 / 60

A developer created the code below to perform an HTTP GETย request to an external system.ย 

public class ERPCatalog {    private final ERP CATALOG URL = http//sampleCatalog.com/cat';     public String getERPCatalogContents() {        Http h = new Http();         HttpRequest req = new HttpRequest(); req.setEndpoint (ERP CATALOG URL);         req.setMethod('GET');         HttpResponse res = h.send(req);         return res.ge_Body();     }}

When the code is executed the callout is unsuccessful and theย integration_updated__c ัhะตckbox to true when it completes.

The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts."ย 

What is the optimal way to fix this?

45 / 60

A developer created the code below to perform an HTTP GET request to an external system.

public class ERPCatalog {	private final ERP CATALOG URL = http//sampleCatalog.com/cat'; 	public String getERPCatalogContents()  {		Http h = new Http(); 		HttpRequest req = new HttpRequest(); req.setEndpoint (ERP CATALOG URL); 		req.setMethod('GET'); 		HttpResponse res = h.send(req); 		return res.ge_Body(); 	}}

When the code is executed, the callout is unsuccessful, and the test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web Service callouts".
What is the optimal way to fix this?

46 / 60

A developer is tasked with creating a Lightning web component that is responsive on various devices.
Which two components should help accomplish this goal? Choose 2 answers

47 / 60

A developer is inserting, updating, and deleting multiple lists of records in a single transaction and wants to ensure that any error prevents all execution.

How should the developer implement error exception handling in their code to handle this?

48 / 60

A developer has a working business logic code, but sees the following error in the test class:

You have uncommitted work pending. Please commit or rollback before calling out.

What is a possible solution?

49 / 60

A software company uses a custom object, Defect__c, to track defects in their software. Defect__c has organization-wide defaults set to private.

Each Defect__c has a related list of Reviewer__c records, each with a lookup field to User that is used to indicate that the User will review the Defect__c

What should be used to give the User on the Reviewer__c record read-onlyย access to the Defect__c record on the Reviewer__c record?

50 / 60

A developer is building a Lightning web component that searches for Contacts.

The component must communicate the search results to other unrelated Lightning web components, that are in different DOM trees, when the search completes.

What should the developer do to implement the communication?

51 / 60

An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won.
This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded Into the Salesforce. instance.

When a test batch of records are loaded, the Apex trigger: creates Contract records. A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.

What is the most extendable way to update the Apex trigger to accomplish this?

52 / 60

Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment 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 fulfillment feature ready for Its go-live in the production

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?ย 

environment.

53 / 60

Refer to the following code snippets:ย 

MyOpportunities.js

import {LightningElement, api, wire } from 'lwc';import getOpportunities from salesforce/apex/OpportunityController.findMyopportunities export default class Myopportunities extends LightningElement {	@api userId; 	@wire (getOpportunities, {oppOwner: '$userId'})	opportunities;}OpportunityController.clspublic with sharing class OpportunityController { @AuraEnabled public static Opportunity getOpportunities(Id oppOwner) {}

A developer is experiencing issues with a Lightning web Component. The component must surface information aboutย Opportunities owned by the currently logged-in user.ย 

When the component is rendered, the following message is displayed: "Error retrieving data".ย 

Which modification should be implemented to the Apex class to overcome the issue?ย 

54 / 60

In an organization that has multi-currency enabled, a developer is tasked with building a Lighting component that displays theย top ten Opportunities most recently accessed by the logged in user.

The developer must ensure the Amount and LastModifiedDate field values are displayed according to the user's locale.ย 

What is the most effective approach to ensure values displayed respect the user's locale settings?

55 / 60

Consider the following code snippet:

public static List<Account> getAccounts (Date thisDate, Id goldenRT) {	List<account accountList = [Select Id, Name, Industry 		FROM Account WHERE CreatedDate = thisDate OR RecordIypeId :goldenRI] 	return accountList; }

The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly.ย 

Which technique should the developer implement to ensure the query performs optimallyย while preserving the entire result set?ย 

56 / 60

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?ย Choose 2 answersย 

57 / 60

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?ย 

58 / 60

A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.ย 

public void updateAndMakeCallout (Map<Id, Request__c> reqs, Map<Id, Request_Line__c> reqlines) { 	Savepoint sp = database.setSavepoint(); 	try { 		insert reqs.values(); 		insert reqlines.values(); 		HttpResponse response = CalloutUtil.makeRestCallout (reqs.keyset(), 		reqLines.keySet()); 	catch (Exception e) { 		Database.rollback(sp): 		System.debug(e);	}}

The callout. util.makeRestcallout fails with a "You haveย uncommitted work pending. Please commit or roll backย before calling outย error.ย 

What should be done to address the problem?

 

59 / 60

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?ย 

60 / 60

@isTest static void testUpdateSuccess() {     Account acct = new Account(Name = 'test');    insert acct;     // Add code here     extension.inputValue  = 'test";     PageReference pageRef = extension.update();     System.assertNotEquals(null, pageRef();}

What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for theย test?

Your score is

The average score is 86%

0%

<!– AddThis Share Buttons generic…
Read More

Aura Events

Aura Events Summary This post will cover topics below:Introduction.Example of Application Event.Example of Component Event….

Read More

Connect to Apex

Aura Connect to Apex Summary This post will cover topics below:IntroductionAttributesConnect to Salesforce Apex exampleReferences…

Read More

Apex Testing

Apex Testing Summary This post will cover topics below: Test Class Test method Test Data…

Read More

SOQL Relationship

Lookup Relationship Summary This post will cover topics below: Summary of the Lookup relationship. Build…

Read More

Classes

Classes Summary This post will cover topics below: Definition of the class Definition of the…

Read More
1 2 3