Knowledge Check

Developer Fundamentals

  • Pages and components are part of which component of the MVC?
    View
  • What platform features are part of the control layer in the MVC model?
    Declarative (workflow, escalation rules) or programmatic (Visualforce controls, Apex classes) business logic
  • What part of the MVC do Salesforce Objects map to?
    Model
  • What are 2 considerations that a developer new to Salesforce should be aware of?
    Limits are enforced on shared resources (Governor Limits). Code cannot be deployed into production unless test code coverage is achieved.
  • What can be created to update a custom field on an unrelated custom object whenever a new account is created in Salesforce?
    Flow for simpler scenarios. Apex triggers for more complex scenarios.
  • Which platform is best to use if you want to create user interfaces without writing code?
    App Cloud (Salesforce Platform)
  • which two programming models are available for building Lightning components?
    Aura components, Lightning Web Components (LWC)
  • What can be done to display a custom user interface that allows users to update several related records simultaneously on the opportunity page in Lightning Experience?
    A custom Lightning Component can be developed and added to the record page using Lightning App Builder
  • Which tool can be used to add custom Lightning components to a page in Lightning Experience?
    Lightning App Builder
  • Which declarative automation tools can be used to perform automated actions for an app in Salesforce?
    Process Builder, Flow Builder, Workflow Rules, Approval Processes
  • What namespace is used by Lightning components that exist in two versions (Aura component and Lightning web component)?
    Lightning Namespace
  • Which annotation should be used for an Apex method that needs to be invoked by a process?
    @InvocableMethod
  • Which property of an object or field can be changed when it is referenced in Apex code?
    Label Name
  • What happens when a field whose value is not specified for an object in an Apex class is made required?
    Apex code throws an exception when it is executed
  • What does the user interface display when a user tries to change the data type of a field that is referenced in Apex code?
    Validation Error
  • What are some options for exporting data from a development environment?
    Data Loader, Workbench, Reports, dataloader.io, ETL tools
  • Can relationship types be changed?
    Master-detail relationships not used in a roll-up summary field can be converted to a lookup relationship, and vice versa, if the lookup relationship field contains values in all of its records
  • What are some limitations of the Data Import Wizard?
    Does not support all standard objects, cannot load more than 50K records, cannot save mappings, cannot export data
  • What is the difference between a lookup and master-detail relationship?
    Both allow one object to be related to another in a one-to-many relationship, but in a master-detail relationship, the detail record wouldn’t exist without the master. Usually when the master is deleted, the detail records are deleted.
  • How is a many-to-many relationship created?
    Using a junction object. This object sits between the two objects in the many-to-many relationship and has two master-detail fields, one for each of the objects to be related.
  • Which relationship can be used on the User object to associate one user with another?
    Hierarchical relationship
  • Which type of relationship model should be used to ensure that the ownership of child records is not inherited from the parent record?
    Lookup Relationship
  • Which type of custom object should be created for a many-to-many relationship in Salesforce?
    Junction object
  • Which type of relationship field should be created to ensure that the value of the field related to the parent record is required on child records?
    Master-detail relationship
  • What is an external ID?
    An external ID contains a unique identifier from a system outside of Salesforce
  • When would creating a formula field be appropriate?
    When a read-only field is required that is calculated based on values of fields (including fields in related objects) or based on a defined formula
  • What are some limitations of roll-up summary fields?
    There is a max number of roll-up summary fields per object. Does not work for lookups. Cannot rollup a formula field that references a field on another object or contains dynamic date function.
  • What functions are available for roll-up summary fields?
    Count, Sum, Max, Min
  • Which formula field function can be used to return the conversion rate o the corporate currency for a given currency ISO code?
    CurrencyRate
  • Which formula would need to be defined in a formula field to add 6 months to a custom field named Contract_Start_Date__c?
    ADDMONTHS(Contact_Start_Date__c,6)
  • Which two options are available to access the token for an object in Apex?
    The getSObjectType method and the sObjectType static member variable
  • Which method can be used to retrieve metadata information for individual objects?
    The describeSObjects() method
  • Which method can be used to check whether an object can be created by the current user?
    The isCreatable() method

Process Automation and Logic: Declarative Features

  • What tool would need to be used to automate deleting a record?
    Flow
  • Which automation tools have the capability to send outbound messages?
    Flows, Workflow, Approval Processes
  • Which automation tools can have a time delay to start actions?
    Workflows, processes, and flows can perform delayed (time-based) actions. A flow can also delay an action by pausing the flow and resuming it based on a date/time, or when a platform event is received.
  • Which automation tool can be used to gather user input?
    Screen flows can accept user input in one or more linked screens, similar to a wizard
  • Which automation tool can be used to guide users through an interactive business process that allows uploading files?
    Flow
  • Which automation tools can be used to create records?
    Process Builder, Flow
  • Which types of flows can be used with external objects?
    Autolaunched and Screen Flows
  • Which automation tool can be used to create a process that allows users to insert an image from a screen?
    Flow Builder
  • Which operations can be performed on external objects from a process?
    Processes can look up, create, or update external objects

Process Automation and Logic: Basic Apex

  • What three possible values can be assigned to a Boolean variable?
    True, False, Null
  • Which variables can be declared as a numerical value with a decimal point?
    Double, Decimal
  • Which type of collection can be used to store key-value pairs?
    Map
  • Which data type can be used to store date and time?
    Datetime
  • Which primitive data type should be used to store a 64-bit number without a decimal point?
    Long
  • Which complex data type supports unique elements?
    Set
  • Which control flow statement is used to executive a block of code only if a certain condition is true?
    If or If-Else statement
  • Which type of loop should be used when the code block needs to be executed at least once?
    Do-While loop
  • Which statement can be used to exit an entire for or while loop?
    Break statement
  • What are the requirements for a class definition?
    Access modifier, class keyword, name of the class
  • What’s the default data access setting of Apex classes?
    Without sharing
  • Which keyword is used by a class to use an interface?
    Implements
  • What can be used to execute a block of Apex code by evaluating and matching an expression against certain unique values specified by the developer?
    Switch statement
  • Which data types are supported by switch statement expressions?
    Integer, Long, sObject, String, Enum
  • Which clause is used to specify the word or phrase to search in SOSL?
    FIND
  • Which optional clause can be used to arrange records in ascending or descending order in both SOSL and SOQL queries?
    ORDER BY
  • Which DML statement can be used to either insert a new record or update an existing record in a single call?
    Upsert
  • Which methods can utilize a SOQL query to retrieve data for display on a Visualforce page?
    Getter method
  • Which clause can be used to filter the results returned by an aggregate function in a SOQL query?
    HAVING statement
  • How many records can be processed by a SOQL for loop at a time?
    A SOQL for loop can process records one at a time using an sObject variable, or in batches of 200 sObjects at a time using an sObject list

Process Automation and Logic: Advanced Topics

  • Which limit can be exceeded when a trigger is not designed to handle several thousand records? Governor limits for DML statements per transaction
  • What can be used to store the logic for all possible trigger events on an object? Handler class
  • How can values in a record about to be saved by accessed and modified? Using the trigger.new context variable
  • Where should database operations occur in a trigger? Outside for loops
  • What are some considerations when writing triggers? Can process automation tools be used instead? Ensure the trigger is bulkified. Use one trigger per object. Ensure the execution context is understood.
  • Which type of trigger should be used to perform complex validation before determining if a delete should proceed? Before delete trigger
  • How is a transaction defined? A code execution unit that is treated as one for governor limit purposes
  • What happens if a governor limit is exceeded to DML operations? If a governor limit exception is raised, DML is rolled back
  • Which DML operations result in the execution of events in the Save Order of Execution? Insert, update, and upsert
  • What are examples of governor limits? Amount of memory allocated, CPU time used, number of queries executed, number of records returned from a query
  • What happens if a trigger with a DML statement triggers itself? Triggers enter an infinite loop and eventually fail
  • Which triggers are executed during the execution of a workflow rule that contains a field update in the Save Order of Execution? Before and after triggers
  • Which exception is thrown when there is an error related to a query? QueryException
  • Which blocks are used for exception handling in Apex? Try, Catch, Finally
  • What types of declarative changes are impacted by the use of Apex? Renaming a field, deleting a field, changing field type
  • Which exception method can be used to obtain an error message? The getMessage method
  • Which keyword can be used to allow an Apex class to run in the sharing mode of the class that called it? Inherited sharing
  • Which functions used in SOQL count as one query row toward the governor limit for the total number of rows that can be retrieved? Count() and Count(fieldName)
  • Which best practice should be followed to avoid exceeding the heap limit? A SOQL for loop should be used to process multiple batches of the resulting records through the use of query() and queryMore()
  • In Apex code, which class should be used to output debug messages for governor limits to determine if or when the code is about to exceed any governor limits? Limits class

User Interface

  • Which component can be used to display individidual fields on a record in a Visualforce page? <apex:outputField>
  • Which coarse grained component can be used to display the detail page of an object in a Visualforce page? <apex:detail>
  • Which iteration component can be sued to generate a table of data with platform styling? <apex:pageBlockTable>
  • Which code can be defined for HTML tags like in a regular HTML page? Inline CSS Code
  • Which tag is used to add CSS to a Visualforce page? <apex:stylesheet>
  • Which component can be used to display an external website in an inline frame within a Visualforce page? apex:iframe
  • What is required to override a tab home page with a Visualforce page? The Visualforce page must use the standard list controller for that tab, a custom controller, or no controller
  • What can be added to a console to display a Visualforce page? Custom console component to the sidebar or footer
  • Where should a Visualforce tab be added to make it available to Salesforce Mobile App users? Salesforce Mobile App Navigation Menu
  • Which communication model is used by the Lightning Component Framework? Event-driven model
  • Where can Lightning components be made available? Salesforce Mobile App, Lightning Experience, and Communities
  • Which design supported by the Lightning Component Framework ensures compatibility with different devices? Responsive Design
  • In the Lightning Component Framework, which resource contains the markup definition for reusable units of an app? Component
  • How can CSS be added to a Lightning component bundle? By clicking the STYLE button in the developer console
  • Which component in a Lightning component bundle is used to expose attributes to the Lightning App Builder? Design
  • Which tag can be used to reference a JavaScript library uploaded as a static resource in .cmp markup? <lntg:require>
  • Which Visualforce overrides are available for Lightning console apps? Visualforce overrides are supported for new, edit, view, tab, list, and clone in Lightning console apps
  • Which attribute of the <apex:page> component is used to associate a standard controller with a Visualforce page? standardController
  • Which attributes of the component can be used to associate a controller extension with a Visualforce page? The extensions attribute
  • Which component can be used to allow users to filter records on a Visualforce page? <apex:selectlist>
  • What can be written as an Apex class to specify the logic for a Visualforce page? Custom Controller
  • Which method can be used in a custom controller to respond to user input on a Visualforce page? Action method
  • Which UI framework allows building single-page web apps with dynamic and responsive user interfaces in Salesforce? Lightning Component Framework
  • What should be used instead of dynamic SOQL to prevent SOQL injection? Static query with a bind variable
  • Which function encodes text and merge field values by inserting escape characters before unsafe JavaScript characters? JSENCODE
  • What can prevent a Visualforce page from using an anti-CSRF token? An action handler in apex:page
  • Which keyword can be used to ensure that an Apex class respects the sharing permissions of the user who is currently logged in? The with sharing keyword
  • Which tag can be utilized in an Aura component to register to an event? <aura:registerEvent>
  • Which tag can be utilized in an Aura component to handle an event? <aura:handler>
  • Which type of event is not subject to the component’s hierarchical setup? Application Event
  • Which type of event is more efficient and should be preferred when an event needs to be handled within the containment hierarchy? Component Event
  • What are the different types of Lightning Components? Standard components, custom components, AppExchange components
  • How can flow hide unnecessary fields on a screen? By using the component visibility settings on a screen component
  • In what ways can Visualforce page be embedded? In page layout and on Lightning pages using the Visualforce component
  • What Salesforce feature should be used to build dynamic PDF documents? Visualforce Page
  • What does Einstein Next Best Action rely on? flows, recommendations, strategies, and components
  • Which function can be used to securely retrieve third-party images on a Visualforce page? IMAGEPROXYURL
  • What can be used to isolate a static HTML file on a separate domain? $IFrameResource., where resource_name is the name of the static resource

Testing

  • What can be used to create test data once and access it through the test class? Test Setup method
  • Which class can contain reusable code for test data creation? Public test utility class, also known as Test Data Factory
  • What can be used to populate test data without using code to create test records? Test.loadData method with a static resource for the csv file containing test records
  • What can be created and executed using the Salesforce testing framework to ensure error-free code? Unit tests
  • What percentage of Apex code must be covered by unit tests before deployment? At least 75%
  • Which tests are run by default for deployment to production? All local tests
  • Which annotation should be used for a unit test method? @isTest
  • Which method can be used to verify whether a test achieves expected results? System.assert()
  • Which two static methods are used to assign a new set of governor limits? startTest() and stopTest()
  • Which page on the Salesforce user interface allows unit class testing? Apex Test Execution
  • What can be used to create or delete tests that can be run together? Suite Manager in Developer Console
  • Which code is not stored in the metadata but can be compiled and executed? Execute Anonymous Block
  • What does not affect actual data after successful code execution? Unit Tests
  • Which default sharing mode is used for anonymous block execution? User Mode with Sharing

Debugging and Deployment

  • What are unmanaged packages typically used for? Distributing free software, tempaltes and open source components
  • What is the difference between a managed package and unmanaged package? A managed package is protected, upgradeable and is typically sold on the AppExchange. Unmanaged packages are not protected and can be used for distribution to others and can be modified once installed
  • What can a change set be used for? Moving metadata between related orgs, for example, from a sandbox to production. It cannot be used for moving data.
  • What is required to use change sets in 2 orgs? A deployment connection between the orgs and each org must explicitly authorize the other org to send change sets to it
  • What are some restrictions of change sets? Code must have 75% test coverage. Not all metadata types are supported. The order of compoennts deployed cannot be specified. Cannot be used to rename or delete components.
  • What option can be used for distributing metadata to multiple unrelated orgs? Unmanaged packages can be used to distribute metadata to unrelated orgs
  • What option would you choose to move metadata in a scripted manner to multiple environments? Force.com migration tool can be used to script deployments to multiple environments
  • What are the different log levels available in Apex? None, Error, Warn, Info, Debug, Fine, Finer, Finest
  • What are the options for moving metadata between environments? Change Sets, Force.com Migration Tool, Visual Studio Code, Workbench, Unmanaged Packages
  • What can be used to record database operations, system processes, and errors that occur when running unit tests? Debug Logs
  • Where can debug logs be viewed, downloaded and deleted? Developer Console and Setup
  • Which suite of tools can be used to query, update, delete, and insert data in Salesforce via the Force.com APIs? Workbench
  • Which Salesforce feature provides a Query Editor for executing SOQL and SOSL queries? Developer Console
  • Which environment is used for migrating and combining changes from different development environments? Integration Environment
  • Which environment can be used for a test deployment before changes are migrated to production? Staging Environment
  • Which types of tests are conducted in a UAT environment? User acceptance tests
  • How many checkpoints can be set in Apex code at a time? Five
  • What can be used to investigate the objects in memory at a specific checkpoint and see the other objects with references to them? Checkpoint Inspector
  • Which file must be created in order to delete metadata components? destructiveChanges.xml
  • Which API provides fine-grained access to an org’s metadata by retrieving smaller pieces of metadata? Tooling API
  • Which tools are available to access functionality provided by Metadata API? Visual Studio Code and Ant Migration Tool
  • What can be accessed to view the Metadata types supported in the latest version of the Metadata API? Metadata Coverage report
  • Where can debug mode be enabled for Lightning components? ‘Debug Mode’ in Setup
  • What are the key milestones in an Application lifecycle when a sandbox is involved? Manage Requirements, Develop Changes in Sandbox, Test Changes, Deploy Changes to Production, Notify End Users of Changes
  • What is the difference between a Developer and a Developer Pro sandbox? Developer Pro has a higher storage limit. Both contain a copy of production configuration and not data. Both can be refreshed once a day.
  • Why would a Partial Copy sandbox be used instead of a Full Copy sandbox? A Partial Copy sandbox is cheaper and can be refreshed more frequently (5 days). It has a data and file storage limit of 5 GB, so a template can be used to define thd ata copied (up to 10,000 records)
  • What is a full copy sandbox usually used for? When an environment that is identical to production is required for performance, load, regression, or user acceptance testing.
  • Which type of user can be traced using a debug log to track data that is synchronized using the Salesforce Integration Cloud? Platform Integration User
  • When creating a new sandbox, what can a developer do to copy data and metadata from an existing sandbox? Clone the existing sandbox
  • When a new sandbox is created, what happens to the users' email addresses? Salesforce appends .invalid to the email addresses. For example, [email protected] becomes [email protected]
  • Which IDE should be used to create and edit Apex code, manage development projects, and migrate metadata components from one org to another? Visual Studio Code
  • When using Visual Studio Code, what must be installed to create and edit Apex, Visualforce, Lightning Aura Components, and Lightning Web Components? Salesforce Extension pack
  • What allows developers to run commands for executing SOQL queries and anonymous Apex code in Visual Studio Code? Salesforce CLI
  • What needs to be set up to generate debug logs when a user performs an action in Salesforce, such as updating an account record? User trace flag
  • What does each debug log contain? Header, execution units, code units, log lines, and other log data
  • Which panel of the Log Inspector shows information in a top-down manner from the initiating calls to the next level down? Stack tree
  • When troubleshooting processes, what is the significance of myVariable_current and myVariable_old? myVariable_current refers to the field value when the process was executed. On the other hand, myVariable_old refers to the most recent previous value.
  • In Salesforce DX, what is the source of truth? Version Control System
  • What is a Scratch Org? A Scratch Org is a dedicated, configurable, and short-term Salesforce environment
  • What developer tool can be used to make code changes effective immediately in an org without installing any software? Developer Console
  • What external web-based platform can be used to query, insert, update, and delete Salesforce data? Workbench

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 exposed:true property to the configuration object of the CustomEvent instance
  • 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
}