A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes. Which tool or mechanism should be utilized for managing the source-driven deployment process?78
A company notices that their unit tests in a test class with many methods to create many records for prerequisite reference data are slow. What can a developer do to address the issue?
A company needs to automatically delete sensitive information after seven years. This could delete almost a million records every day. How can this be achieved?
A developer is writing a Jest test for a Lightning web component that conditionally displays child components based on a user’s checkbox selections. What should the developer do to properly test that the correct components display and hide for each scenario?
A company wants to track revenue through a related object. They need to perform a one-time seeding of data for roughly 100,000 Opportunities, creating Revenue records based on complex logic. What is the optimal way to automate this?
The test method calls an @future method that increments a value. The assertion is failing because the value equals 0. What is the optimal way to fix this?
Java
@isTest
static void testIncrement() {
Account acct = new Account(Name = 'Test', Number_Of_Times_Viewed__c = 0);
insert acct;
AuditUtil.incrementViewed(acct.Id); // This is the @future method
Account acctAfter = [SELECT Number_Of_Times_Viewed__c FROM Account WHERE Id = :acct.Id][0];
System.assertEquals(1, acctAfter.Number_Of_Times_Viewed__c);
}
A developer built an Aura component for guests to self-register upon arrival at a front desk kiosk. Now the developer needs to create a component for the utility tray to alert users whenever a guest arrives at the front desk. What should be used?
A developer created a class that implements the Queueable Interface, as follows:
Java
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?1
A developer is trying to decide between creating a Visualforce component or a Lightning component. Which scenario necessitates the use of Visualforce?
Consider the following code snippet:
HTML
How should the
Refer to the code snippet below:
Java
public static void updateCreditMemo(String customerId, Decimal newAmount){
List
for(Credit_Memo__c creditMemo : [Select Id, Name, Amount__c FROM Credit_Memo__c WHERE Customer_Id__c = :customerId LIMIT 50]) {
creditMemo.Amount__c = newAmount;
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, the developer needs to ensure race conditions are prevented when a set of records are mod1ified within an Apex transaction. In the preceding Apex code, how can the developer alter the que2ry statement to use SOQL features to prevent race conditions within a tr3ansaction?4
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?
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?
Refer to the component code and requirements below:
HTML
Requirements:
For mobile devices, the information should display in three rows.
For desktops and tablets, the information should display in a single row.
Requirement 2 is not displaying as desired. Which option has the correct component code to meet the requirements for desktops an7d tablets?
A developer is asked to develop a new AppExchange application. A feature creates Survey records when a Case reaches a certain stage. This needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the app needs to come with a set of best practice settings. What should the developer use to store and package the custom configuration settings for the app?
A Salesforce developer is hired by a multi-national company to build a custom Lightning application that shows employees their employment benefits and earned commissions over time. The application must acknowledge and respect the user's locale context for dates, times, numbers, currency, and currency symbols. When using Aura components, which approach should the developer implement to ensure the Lightning application complies with the user's locale?3
Refer to the code below:
Lightning Web Component JS file
JavaScript
import {LightningElement} from 'lwc';
import serverEcho from '@salesforce/apex/SimpleServerSideController.serverEcho';
export default class Helloworld extends LightningElement {
firstName = 'world';
handleClick() {
serverEcho({
firstName: this.firstName
})
.then((result) => {
alert('From server: ' + result);
})
.catch((error) => {
console.error(error);
});
}
}
Apex Controller
Java
public with sharing class SimpleServerSideController {
@AuraEnabled
public static String serverEcho(sObject firstName) {
String firstNameStr = (String)firstName.get('firstName');
return ('Hello from the server, ' + firstNameStr);
}
}
Given the code above, which two changes need to be made in the Apex Controller for the code to work?
Consider the following code snippet:
HTML
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 t13he section identified with opportunityList is re-drawn on the screen?1415
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?12345
Business rules require a Contact to always be created when a new Account is created. What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?
Which code snippet processes records in the most memory efficient manner, avoiding governor limits such as "Apex heap size too large"?
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?3132
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users encounter "View State" errors when using it in production. What should the developer ensure to correct these errors?
A developer needs a Lightning web component to display in one column on phones and two columns on tablets/desktops. Which should the developer add to the code?
Universal Containers needs to integrate with their own, existing, internal custom web application. The web application accepts JSON payloads, resizes product images, and sends the resized images back to Salesforce. What should the developer use to implement this integration?
When developing a Lightning web component, which setting displays lightning-layout items in one column on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?
A developer needs to store variables to control the style and behavior of a Lightning Web Component. Which feature can be used to ensure that the variables are testable in both Production and all Sandboxes?
Universal Containers wants to develop a recruiting app for iOS and Android via the standard Salesforce mobile app. It has a custom user interface design and offline access is not required. What is the recommended approach to develop the app?
Which statement is considered a best practice for writing bulk safe Apex triggers?
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?
As part of a custom interface, a developer team creates various new Lightning web components. Each of the components handles errors using toast messages. During acceptance testing, users complain about the long chain of toast messages that display when errors occur loading the components. Which two techniques should the developer implement to improve the user experience?
A developer is writing code that requires making callouts to an external web service. Which scenario necessitates that the callout be made in an asynchronous method?
A developer implemented a custom data table in a Lightning web component with filter functionality. However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters. What should the developer do to improve performance of the component?
Consider the following code snippet:
Java
HttpRequest req = new HttpRequest();
req.setEndpoint('https://TestEndpoint.example.com/some_path ');
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 two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code?1
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?
An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. A developer is tasked with preventing Contract records from being created when mass loading historical Opportunities, but the daily users still need the logic to fire. What is the most extendable way to update the Apex trigger to accomplish this?
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 technique for a developer to troubleshoot this?
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 two steps should a developer take to accomplish this?
How should a developer assert that a trigger with an asynchronous process has successfully run?
Refer to the test method below:
Java
@isTest
static 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?
A developer creates a lightning web component to allow a Contact to be quickly entered. However, error messages are not displayed.
HTML
Which component should the developer add to the form to display error messages?12
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?1
A company has a Lightning page with many Lightning Components, some that cache reference data. It is reported that the page does not always show the most current reference data. What can a developer use to analyze and diagnose the problem in the Lightning page?
A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called Survey_Response__c do not belong to a list of blocked domains. The list of blocked domains is stored in a custom object for ease of maintenance by users. The Survey_Response__c object is populated via a custom Visualforce page. What is the optimal way to implement this?
Which select statement should be inserted to retrieve Tasks ranging from 12 to 24 months old, including archived tasks, and excluding deleted ones?
Java
Date initialDate = System.Today().addMonths(-24);
Date endDate = System.Today().addMonths(-12);