Practice Exam Question Review

User Interface (Objective 1)

  • In a Visualforce page that uses a standard set controller, a user selects 10 accounts from a list of accounts and wants to be able to set the field value for all the selected records. Which controller methods should the developer use to identify the records that were selected and perform a mass update? getSelected(): returns a list of records that are selected. getRecord(): returns the sObject that represents the changes to the selected records
  • What standard controller action aborts an edit operation and returns the user to the page where the edit originated? Cancel
  • Which of the following should a Salesforce developer keep in mind about getter and setter methods in Visualforce?
    • Getter methods must always be named getVariable while setter methods must always be named setVariable.
    • Any setter methods in a controller are automatically executed before any action methods. Setter methods pass user input from a form, for example, on a Visualforce page to pass it to the controller.
    • While a getter method is always required to access values from a controller, it’s not always necessary to include a setter method to pass values into a controller
  • A developer is creating a custom controller which will contain a web service method. Which access keyword must be used to declare the class? global
  • Which of the following statements are true about displaying data on a Visualforce page? Expression syntax is used to bind components to the data set available in the page controller. Data context is provided to the controller using the id parameter of the page.
  • A developer needs to access a list of data on a Visualforce page and represent the data as a table. However, the developer would also like to customize the look and feel and not use the standard Salesforce styling. What Visualforce components can the developer use? apex:dataTable, apex:dataList, apex:repeat
  • Getter methods should:
    • Be named getVariable, such as getCaseRecord where the value that needs to be iterated in the data table is CaseRecord.
    • To display the results of a getter method on a page, the name of the getter method is used without the ‘get’ prefix.
    • When querying records, the fields that are needed should be specified in the SOQL SELECT statement.
  • Which of the following is true about defining getter methods in Visualforce? Every value that is calculated by a controller and displayed on a page must have a corresponding better method. A ‘set’ method should be used to pass data from a Visualforce page to its Apex controller. To pass data from an Apex controller to a Visualforce page, a ‘set’ method must be used.
  • A developer is considering using a standard controller on a Visualforce page. Which of the following are valid considerations about standard controllers? Every standard controller includes a getter method that returns the record specified by the id query string parameter in the page URL. To associate a standard controller with a Visualforce page, use the StandardController attribute on the apex:page tag and assign it the name of any Salesforce object that can be queried using the Force.com API. The standard controller provides a set of standard actions, such as edit, save, and delete, that you can add to your pages using standard user interface elements such as buttons and links.
  • Cosmic Solutions is creating a Visualforce page to render the current user’s “First Priority” cases. Management has defined those cases as those that are “High” priority, have a skill rating that matches the user’s skill rating, and are in “New” status. Skill rating is defined by corresponding custom fields on the Case object and the User object. A developer has decided to use a Standard Set Controller to render the appropriate cases on teh Visualforce page. She will create an Apex class “FirstPriorityCaseController” to run server-side logic, including “priorityCases” as the attribute which stores the current list of cases to render. Which of the following can she do to accomplish this? Create an ApexPages.StandardSetController with defined query conditions or results. Use the getRecords() method to return the priorityCases attribute value. Render an apex:pageBlockTable with value set to “{!priorityCases}”.
  • A developer is required to create a page that will show and add actions on a set of records. What controller can accomplish this with the least effort? Standard List Controller. These allow developers to create Visualforce pages that can display or act on a set of records. Standard List Controllers can be represented just by adding recordSetVar tag on apex:page. Custom List Controllers are similar, but require coding in a custom controller or in an extension.
  • Given the Visualforce page snippet below, which of the following statements are true? It is possible to have multiple extensions on a single Visualforce page, and extensions can be reused on different pages. LeadExtA, LeadExtB, and LeadExtC are controller extensions used by the Visualforce page. LeadExtA, LeadExtB, or LeadExtC cannot be used without the ‘Lead’ standard controller.
  • A developer has uploaded a file called ‘StyleResource’ to a Salesforce org. The static resource contains a CSS file named ‘cosmic.css’. How can this CSS file be referenced in a Visualforce page that the developer is working on? <apex:stylesheet value="{!URLFOR($Resource.StyleResource,'cosmic.css')}"/>
  • A Visualforce page uses a custom Apex controller class. An ID parameter value was passed to the URL. How can a Salesforce developer retrieve the record using this value? Use ApexPages.currentPage().getParameters() to get the parameter value then make a query to the record using the ID in the controller’s constructor
  • What attribute should the developer use to render a Visualforce page as a PDF file? renderAs='pdf', which generates a downloadable, printable PDF file of a Visualforce page using the PDF rendering service.
  • A developer has written code that will return a query locator containing 11,000 records. What will happen if he instantiates a StandardSetController using this query locator? The StandardSetController will not be instantiated and an exception will be thrown. Instantiating StandardSetController using a query locator returning more than 10,000 records causes a LimitExceptions to be thrown.
  • A developer is required to build a Visualforce page that allows a user to upload an attachment for a record. In the form, fields such as Name and Description must be populated, as well as certain additional fields saved to the parent record. Which Visualforce controller should be used for this? Custom Controller, since a standard controller is not capable of saving an attachment record or updating field values on the parent record. List Controllers (Standard or Custom) are used for Visualforce pages that display or handle multiple records.
  • Preferred method to include javaScript files in Visualforce pages? Save it as a static resource and reference it via apex:includeScript
  • Which of the following statements about setter methods are true? Setter methods are executed prior to action methods. Setter methods must always be conventionally named setVariable where “variable” is the property name. The [set] method is used to pass values from Visualforce page to the controller
  • Which attribute should a developer use to associate a page with the standard controller for a custom object? standardController
  • Which of the following statements are true about using the transient keyword in a custom controller? Transient keywords can be used for a field in a Visualforce page that is needed only for the page request duration. Transient keywords can be used to declare instance variables that cannot be saved. Transient keywords can be used in Apex classes that define types of fields declared in the serializable classes.
  • Which are true regarding StandardSetControllers? They can be used to allow ‘list controllers’ similar to pre-built Visualforce list controllers to be created. It can be used for mass updates. It can be used to allow ‘pre-built list controllers’ to be extended.

User Interface (Objective 2)

  • A developer has craeted a Visualforce page that contains the code below. What is the security vulnerability in the code? <apex:outputText value="{!name}" escape="false" />. The page is vulnerable to Cross-Site Scripting (XSS) attacks since it uses the attribute escape=“false” in the snippet. By default, nearly all Visualforce tags escape the XSS-vulnerable characters, but it is possible to disable this behavior by setting the optional attribute escape=“false”
  • A developer created a Visualforce page. It should be displayed as a separate tab. Which of the following statements are true? The Visualforce page to display in the custom tab is selected when the tab is created. Tabs can be linked directly to a Visualforce page.
  • A developer is building a shopping card page using Aura components. It has three components, namely, cartItems, CostSummary, and relatedItems. Each component has been placed at the same level in a container. When an item is removed from the cartItems component, the costSummary component should update the summary accordingly by taking into account taxes, shipping fees, etc. When the ‘Add Item to Cart’ button in the relatedItems component is clicked, the cartItems component should automatically display the added item, and the costSummary component should also update its summary. Which type of event should be used to meet this requirement? Application Event
  • What should a Salesforce Administrator consider before overriding the View standard button? Different override behavior for Salesforce Classic, Lightning Experience, and Mobile can be set. Overriding the View standard button will reroute all links in Salesforce that display the detail page for a record.
  • A Salesforce developer would like to expose a custom event of a Lightning web component so that other custom Lightning components within the page can respond to it accordingly. Which of the following is a valid step in order to expose such events in Lightning App Builder? Add the and subtags to the configuration file of the component
  • A button needs to be added to a Lightning web component that allows users to navigate to the standard ‘Accounts’ tab in the Salesforce org for accessing account records. If ‘NavigationMixin’ is used for handling the navigation, which of the following options should be specified as the ‘onclick’ event handler for the button in order to meet the requirement? Lightning navigation service uses a page reference, instead of a hard-coded URL, to navigate to different page types within the Salesforce platform. To use the navigation service, ‘NavigationMixin’ is imported from the ‘lightning/navigation’ module. To navigate to the Accounts tab, or the home page of the Account object, the ‘type’ property should be set to ‘standard__objectPage’, the ‘objectApiName’ set to ‘Account’, and the ‘actionName’ can be set to ‘home’. The ‘actionName’ can also be set to ‘list’, and then an associated list view can be specified.
goToAccounts() {
    this[navigationMixin.Navigate]({
        type: 'standard__objectPage',
        attributes: {
            objectApiName: 'Account',
            actionName: 'home'
        }
    })
}
  • Which of the files below can the $ContentAsset global value provider reference? CSS files, images, JavaScript files
  • A Lightning message channel called “SampleChannel” is used by custom Lightning components and a Visualforce page on a Lightning page for sending and receiving messages. A Salesforce developer is creating a custom Lightning web component and needs to publish messages in the channel whenever a user has completed processing a record using the custom component so that other components on the page can respond to the update if necessary. Which of the following can be used in order to reference the Lightning message channel in the component’s client-side controller? import sampleChannel from "@salesforce/messageChannel/SampleChannel__c"; Lightning Message Service enables communication across the DOM by allowing Lightning web components, Aura components, and Visualforce pages to send and receive messages through a Lightning message channel, which is a metadata type called LightningMessage Channel. A Lightning web component can reference the message channel by importing it via the @salesforce/messageChannel scoped module, and then specifying the channel with a __c suffix appended to the name of the metadata, although it is not a custom object.
  • A custom Lightning web component is being developed that will, among other features, allow users to perform inline editing of one opportunity record in a table at a time. If the editable fields are ‘Name’ and ‘Amount’, which of the following options can be used in the ‘handleSave’ function to retrieve the changed values from the table, given the code below? The ‘draft-values’ attribute of the component isused to track the changes made inline. The ‘onsave’ event is invoked when the ‘Save’ button on the table is clicked and can be used to send the draft values to the server using the ‘updateRecord’ function, which is an imported function from the ‘lightning/uiRecordApi’ module, to save the changes.
<!-- component markup -->
...
<lightning-datatable key-field="id" data = {results.data} columns={columns} hide-checkbox column onsave={handleSave} draft-values={draftValues}></lightning-datatable>
...

<!-- component controller -->
import { updateRecord } from 'lightning/uiRecordApi';
...
handleSave(event) {
    const fields = {};

    // retrieve the changed values here

    const recordInput = { fields };
    updateRecord(recordInput)
        .then(() => {
            ...
        });
}
  • Support agents use a custom console app in Lightning Experience to manage multiple records on a single screen. A developer has created a Visualforce page that allows users to input data related to cases. Which actions are supported for overriding with the Visualforce code in the console app? New, Edit, View, Tab, List, and Clone actions in Lightning console apps support Visualforce overrides. They are not currently supported for delete and custom actions
  • A developer is building a Lightning web component that will be used to view the details of an account that has the specified record Id. She is using the ‘getRecord’ wire adapter but is seeing an error. @wire(getRecord, { recordId: this.accountId, fields: [NAME_FIELD, RATING_FIELD, PHONE_FIELD, INDUSTRY_FIELD] }) How can the preceding line be modified to ensure it works as expected. @wire(getRecord, {recordId: '$accountId', fields: [NAME_FIELD, RATING_FIELD, PHONE_FIELD, INDUSTRY_FIELD] }) The value of ‘this.accountId’ does not work since ‘this’ is undefined when the wire service tries to retrieve the data upon initial load. The string ‘$accountId’ should be used instead. The $ means that the value of the ‘accountId’ variable is dynamic. When a new value is available, the wire service retrieves new data and the component is rerendered.
  • An administrator has configured the Next Best Action component to display recommendations to its CSRs regarding phone plans. When a CSR accepts a recommendation for a customer who wants to upgrade, a flow is launched to process the upgrade. If the offer is rejected, the flow needs to perform a different action. How? Build a single flow to perform an action that is used when a recommendation is accepted or rejected. Enable ‘Launch Flow on Rejection’ for the Next Best Action component in Lightning App Builder
  • A developer wants to utilize the createRecord() function, which is one of the functions available in the uiRecordApi module built on top of the Lightning Data Service, for creating records without writing Apex code. In the code used for the LWC below, how can createRecord be called in the handleClick() function to send the request to the server?
import { LightningElement, wire, api } from 'lwc';
import { createRecord } from 'lightning/uiRecordApi';

export default class RecordManager extends Lightning Element {
    ...
    name = '';
    amount = 0;
    closeDate = '';
    ...
    handlClick() {
        
        const fields = {};

        fields['Name'] = this.name;
        fields['Amount'] = this.amount;
        fields['CloseDate'] = this.closeDate;

        const recordInput = {apiName: 'Opportunity', fields};

        // call createRecord function here
    }
}
createRecord(recordInput).then(() => {
    // New record created - do more stuff
})
  • A developer is building an Aura component with a button that should change the background image of an Aura component that is the root component on an app page. The component containing the button is buried deep down several layers of nested components, as the innermost component. What type of event should be used to trigger the event that the application’s root component is expected to handle? Component Event, not Application Event. Regardless of the containment hierarchy or nested layer in which the button is located, the ‘Bubble’ phase of the component event would propagate the event upwards in the containment hierarchy until it reaches the root component or main container.
    Component events support two phases of component event propagation, namely, ‘Bubble’ and ‘Capture’. The default phase is the Bubble phase. When a component event uses the Bubble phase, the source component gets to handle the event first when the event is fired. Next is its parent component, followed by the grandparent, and then each component all the way up until the root component.
    On the other hand, if a component event uses the ‘Capture’ phase, the order of the event propagation behaves in a top-down manner. When the source component fires the event, the root component gets to handle the event first and the propagation traverses down the containment hierarchy until it reaches the source component. Although an application event would also cause the root component to receive the event, this type of event is used only if a component event is unable to meet the requirement. Application events broadcast events to all components in the application, which could adversely affect performance.
  • A company wants to take advantage of a new campaign by being able to provide the right offerings quickly to each customer and get as many new subscriptions, plan upgrades, and contract renewals as possible. The marketing head has heard about Einstein Next Best Action and requested to roll it out for the company’s users. Some considerations? The action strategy and its source must be specified in the configuration of the Einstein Next Best Action component. Strategy Builder or Flow Builder can be used to define a strategy for loading recommendations based on criteria. Flow Builder must be used to create a flow that gets invoked with a recommendation is accepted.
  • A developer would like to reference an external JavaScript library in an Aura component that is currently being developed. Which of the following options should be considered when working with such a library? A set of resources can be loaded using the ‘scripts’ attribute. The library must be uploaded to Salesforce as a static resource. $Resource is used to include the name of the JavaScript resource.
  • An Apex class designed to run in system context is being used to perform a SOQL query on an Employee custom object. The result of the query includes sensitive information that some users may not be allowed to view. Which option represents the correct implementation of the Security.stripInaccessible() method to prevent users from viewing the fields they shouldn’t have access to? Apex that runs in system context ignores object-level and field-level permissions of the current user. The Security.stripInaccessible() method can be used to strip data from records based on the object-level and field-level permissions of the current user. An AccessType enum value is specified, which determines the type of access check the method should perform. In this case, AccessType.READABLE is used to strip off data that the current user does not have Read access to. Other options are AccessType.CREATABLE, AccessType.UPDATABLE, and AccessType.UPSERTABLE. The method returns an SObjectAccessDecision object that contains functions such as getRecords() for returning a list of the stripped records.
List<Employee__c> employees = [SELECT Name, SSN_No__c, FROM Employee];
SObjectAccessDecision decision = Security.stripInaccessible(AccessType.READABLE, employees);
return decision.getRecords();
  • A developer would like to use the Lightning message service to allow different users interface components to send and receive messages across the DOM. She wants to specify the message payload fields in the configuration file of the Lightning message channel. Which Lightning Message Field configuration structure below is correct? To specify a message payload field in the configuration file of a Lightning Message Service channel, the name and description of each field are contained inside a tag. The property is a required unique identifier for a Lightning Message Field. The property is an optional attribute used to describe the Lightning Message Field.
<lightningMessageFields>
    <fieldName>field1</fieldName>
    <description>description1</description>
</lightningMessageFields>
<lightningMessageFields>
    <fieldName>field2</fieldName>
    <description>description2</description>
</lightningMessageFields>

  • Where can a developer use Visualforce in Lightning Experience? Navigation Bar, Custom App, Standard Page Layout. A developer can display a Visualforce Page from the App Launcher, add a Visualforce Page to the Navigation Bar, display a Visualforce Page within a Standard Page Layout, and launch a Visualforce Page as a Quick Action by overriding Buttons or Links.
  • A developer has created the custom controller below for a Visualforce page. Which of the following is the correct method of using a static query with a bind variable to prevent a SOQL injection attack? In order to prevent a SOQL injection attack, instead of using a dynamic SOQL query, static query and bind variable can be used, such as below. When binding variables in a static query, a colon is added before the variable. Dynamic queries require the Database query method.
String queryName = '%' + name '%';
List<Contact> queryResult = [SELECT Id FROM Contact WHERE (IsDeleted = false AND Name LIKE :queryName)];
  • A developer is building an event registration app using Aura Lightning components. The application nests a “Form” Lightning component and a “Calendar” Lightning component such that the two are on the same level in the hierarchical structure. One requirement is that the dropdown list on the Form should be updated with the available events based on the date that the user selects from the Calendar component. Which are true? An Application type event should be used. Use the default phase, so that all listening components will be able to capture the event. An Application type event is necessary in this scenario since the Calendar component can broadcast event data application-wide when a user clicks on a date. Using a Component type event, the event bubbles up (or top-down for capture phase) the hierarchy, which means that the Form component would not be able to capture the event that is fired by the Calendar component.
  • A Salesforce developer has been asked to display a greeting message in an Aura component. The message should be should be editable from the user interface such that users can change it without asking the developer. What steps are required to meet this requirement? Add an aura:attribute to the component markup that would serve as the message attribute. Replace the value of the h2 tag with the expression syntax that references the message attribute value. Add the design:attribute to the Design resource that would serve as the configuration field for storing the message.
  • A developer has a requirement to customize the Account record page so that it includes an inline list of related opportunities and a search field to help users easily find records. What are the simplest options to achieve this requirement? Create and embed a Visualforce page into the Account Lightning record page. Create and embed a Visualforce page into the Account page layout.
  • What is true about incorporating a Visualforce page in the Lightning Platform? Visualforce pages should be added to a tab to be accessible in the App Launcher. The option ‘Available for Lightning Experience, Lightning Communities, and the mobile app’ must be enabled for a Visualforce page.
  • What is true about how Salesforce deals with cross-site scripting (XSS) attacks? Salesforce has implemented filters that screen out harmful characters in most output methods as one of the anti-XSS defenses. All standard Visualforce components, which start with , have anti-XSS filters in place.
  • A developer is building a Lightning web component that will allow the current user to search for an account record, view the account details, get additional info about the account from an external system, and update the account and related records using the entered info. The company is using a private sharing model for account records, but the LWC should allow the current user to access any account record that is stored in Salesforce, regardless of whether the user can view the record. The developer will be creating an Apex controller to perform actions like retrieving and updating the account record. Which are true? The Apex controller must use the without sharing keyword to bypass sharing rules that apply to the user. The behavior of an @AuraEnabled Apex controller that does not use a sharing keyword defaults to with sharing.
  • Which of the following are true regarding the various types of content inside a LWC? An SVG resource can be added to the component to be used as a custom icon in Lightning App Builder. A CSS file can be added to style the component. If the component doesn’t render UI, it doesn’t require an HTML file.
  • A developer would like to display a Visualforce page from a custom button on the Account page layout. Which of the following are true? Custom Buttons can be added to standard page layouts. Custom Buttons will work with standard or custom objects.
  • A developer needs to surface an Aura component on a Lightning record page. Which of the following can they do to achieve this? Implement the flexipage:availableForAllPageTypes interface on the Aura component. Implement the flexipage:availableForRecordHome interface on the Aura component. flexipage:availableForAllPageTypes allows the Aura component to be added to any type of Lightning page, including record pages. flexipage:availableForRecordHome allows the Aura component to be added to record pages only. force:hasRecordId enables the passing of the record id to the component but is not required for the component to be added to record pages. force:hasSObjectName allows the SObject name of the record to be passed to the component, and is also note required to achieve the objective.
  • An Aura component bundle contains a component or an app and all its related resources. What are these? Component or Application, CSS Styles, Controller, Design, Documentation, Renderer, Helper, SVG file
  • What does the Helper resource in an Aura component bundle contain? Functions that can be called from any part of the controller in the component bundle

Practice Exam 1

  • Given the following Visualforce page snippet, which of the following statements are true?
    • LeadExtA, LeadExtB, and LeadExtC are controller extensions used by the Visualforce page
    • LeadExtA, LeadExtB, or LeadExtC cannot be used without the Lead standard controller
    • It is possible to have multiple extensions on a single Visualforce page, and extensions can be reused on different pages
<apex:page standardController="Lead" extensions="LeadExtA, LeadExtB, LeadExtC">
    <apex:outputText value="{!display}" />
</apex:page>
  • A Salesforce developer would like to expose a custom event of a Lightning web component so that other custom Lightning components within the page can respond to it accordingly. Which of the following is a valid step to expose such events in Lightning App Builder?
    • Add the <event> and <schema> subtags to the configuration file of the component
  • A developer is creating a Visualforce page to render a table of cases. He is considering the use of a Standard List Controller to avoid unnecessarily building a custom controller. Which of the following are benefits of Standard List Controllers?
    • A dynamic number of records can be rendered on the page
    • Existing List View filters can be applied
    • Pagination of records
  • Which of the following should be used to execute specific Apex test methods in an organization?
    • Developer Console
    • Visual Studio Code
    • SOAP API
  • A developer uses 3 custom objects to track motors, the cars they go in, and the components of the motor. The objects were set up to have the labels Motor, Car, and Component, respectively, and accepted the default API name for each object. The plural labels of the objects are Motors, Cars, and Components. Motor has a lookup field to Car, while Component has a Master-Detail relationship to Motor. The developer accepted the default child relationship names when these relationship fields were set up. Which of the following queries show the correct syntax for performing relationship queries between these custom objects?
    • SELECT Name, Car__r.Name FROM Motor__c WHERE Name LIKE \'1000x%\'
    • SELECT Name, (SELECT Name FROM Components__r) FROM Motor__c WHERE Name LIKE \'1000x%\'
  • A developer has created a nightly Apex job that fetches account records from an external portal used by the company. This Apex job involves retrieving account records in batches of 20 per transaction and is scheduled to run every night at 9 PM. A batch class with a method that executes a web service callout has been defined inside a scheduled class. How can the developer determine if the jobs have been running without any issues?
    • View information about all the completed Apex jobs by navigating to ‘Apex Jobs’ in Setup
    • View information about all the jobs that are scheduled to run by navigating to ‘Scheduled Jobs’ in Setup
  • An organization has enabled Multiple Currencies. A developer needs to calculate the total of the Estimated_Value__c on the CampaignMember object using a roll-up summary field on the Campaign object named Total_Estimated_Value__c. Which of the following is a true statement regarding the currency of the Total_Estimated_Value__c field?
    • The field values of Estimated_Value__c on campaign member records would be converted into the currency of the parent campaign, and the Total_Estimated_Value__c would be displayed using the same currency.
  • What are considerations for deciding between using Data Loader and Data Import Wizard for loading data into a dev environment?
    • Number of records to load
    • Whether data needs to be loaded multiple times
    • If the object is supported by the data import tool
  • A company uses an external order management application to manage orders. Sales users use the application to create orders manually after winning sales deals. The sales director would like to automate this process. When an opportunity is won, the external application should receive a notification and create the associated Order record automatically based on the details in the notification. A developer has decided to use a platform event for this use case. Which of the following should be utilized when using a platform event to meet this requirement?
    • Platform event definition with custom fields
    • Apex triggers or process that publishes an event message
    • Comet client that subscribes to the platform event channel
  • A developer is using a <lightning-datatable> to display records in a Lightning web component and wants to make sure it supports inline editing for multiple records at a time. What is the most efficient way to do this?
    • Pass the data changes to an Apex controller method that handles the bulk update of multiple records
  • An Admin has created a process using Process Builder that runs every time an opportunity record is edited. The process calls an Apex class that executes custom business logic. It keeps failing halfway through the transaction every time. What are the first steps the administrator should take to identify the issue?
    • Set a user trace flag by navigating to ‘Debug Logs’ in Setup, edit an opportunity record, and check the generated debug log
    • Check the detailed error email sent to the administrator to identify the issue
  • An organizations CTO is concerned about the use of third-party images in Visualforce pages due to recent reports about images stealing usernames and passwords. Which function can a developer use to securely fetch images that are outside an org’s server and prevent them from requesting user credentials?
    • IMAGEPROXYURL
  • A developer needs to write a trigger on the Survey custom object. The trigger will use the email address on the Survey record as a unique key to look for a matching email address on the existing contact records. If a matching email address is found, the Name of Contact field on the Survey record should be populated with the name of the contact found. what is the best collection data type to use when storing contact records in this scenario?
    • Map
  • A company is performing a code review for a custom Salesforce application built by a developer to identify any security vulnerabilities before releasing it in production. Given the following code, what should be advised?
    • Compare the variable de against expected values instead of null
// a department represents an existing department in the company
String dep = ApexPages.currentPage().getParameters().get('department');
if (dep != null) {
    String query = 'SELECT Id, Name from ' + dep + ' limit 10';
    // process query here
}