Refer to the following code snippet:
Java
public class LeadController {
public static List
String safeTerm = '%'+searchTerm.escapeSingleQuotes()+ '%';
return [
SELECT Name, Company, AnnualRevenue
FROM Lead
WHERE AnnualRevenue >= :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 getFetchLeadList 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?1
Universal Containers implements a private sharing model for Convention_Attendee__c. A lookup field Event_Reviewer__c was created. Management wants the event reviewer to automatically gain Read/Write access to every record they are assigned to. What is the best approach?
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 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?
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?1234
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?
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?
Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?
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?
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?