PD1 Cert Flashcards

1
Q

“Control layer” in the MVC model?

A
  1. Visualforce Controllers
  2. Apex Custom Controllers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

“My Domain” needs to be deployed if -→

A

Lightning components need to be used in Lightning tabs, Lightning Pages, as standalone apps, as actions and action overrides, or as custom lightning page templates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how to access a compound data type such as geolocation?

A

__s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

“Application Events” vs “ Component Events”

A

Application Events -→ allow all components on a page, regardless of the containing component, to respond to an event

Component Events -→ can only be handled by components in the firing components containment hierarchey

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Examples of Limits enforced by “Apex Runtime”

A
  • time executing a SOQL query
  • total number of records retrieved by SOQL queries
  • CPU time per transaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ways to run a “Flow” automatically in the future?

A
  • replace the autolaunched flow with a schedule triggered flow
  • invoke the flow from an Apex job that runs weekly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what tool can be used to create a wizard like interface where details can be entered on one screen and a calculation displayed on the next screen ?

A

flow builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Things that can be created using the lightning app builder?

A
  • custom home pages
  • custom record pages
  • single-page apps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

most appropriate place to put functions that can be called by any Javascript code

A

Helper file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Helper File =

Component File=

Controller File =

Design File=

A

Helper File = most appropriate place to put functions that can be called by any Javascript code in a component bundle

Component File = contains the markup for the component

Controller File = contains functions that are typically called as a result of a browser or platform event

Design File = exposes attributes of the component that can be modified from an interface such as lighting app builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

events that are fired when an Aura component loads on a page

A
  • init
  • render
  • afterRender
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a “Batch Apex Job”?

A

-logic that can be set to run at regular intervals and perform the required logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Characteristics of a multi-tenant environment in context of platform upgrades

A
  • salesforce upgrades are automatic
  • sandboxes are upgraded prior to production environments so that the changes can be previewed and tested
  • all customizations are specified as metadata, allowing for easy upgrades
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

indirect lookup relationship?

A

links a child external object to a parent standard or custom object

*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

components that if a field is referenced, the reference should be deleted or updated first before the field can be deleted

A
  • apex class
  • apex trigger
  • visualforce page
  • visualforce component

workflow rule

  • field update
  • criteria based sharing rule
  • flow
  • jobs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how to improve the speed of “Schema Builder” tool

A
  • the map can be used to navigate objects of interest
  • if the “hide relationships” option is selected, performance is improved
  • the filter can be used to only display objects of interest
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What should be used to create ‘Scratch Orgs’?

A

Salesforce CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Characteristics of @InvocableMethod

A
  • must be declared as static
  • only one method can be defined per Apex Class
  • method can be declared as public or global
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

how should a developer write unit tests for a private method in an Apex Class?

A

use the “@Test Visible” annotation

@TestVisible -→ annotation allows test methods to access private or protected members of another class outside the test class (members include methods, member variables, and inner classes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what should a developer do to check the code coverage of a class after running all tests?

A

view the Overall Code Coverage panel of the Tests tab in the developer console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Characteristics of “ChangeSet Deployments”

A

Change set -→ can be used to send customizations from one Salesforce org to another

  • Changesets can only be used between related organizations
  • deployment is done in a one-way, single transaction
  • sending a changes between two orgs requires a deployment connection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Scratch org

A

salesforce environment that can be easily created to support agile development and continuous integration

*Salesforce CLI is used to manage and create scratch orgs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What should a developer use to fix a lightning web component bug in a sandbox?

A

VS code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

define “Bulk API”

A

provides a programmatic option to asynchronously upload, query, or delete large data sets in your Salesforce org

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
random APEX characteristics:
- classes are final by default - top-level class can only have one inner class level
26
Valid “External ID” data types/fields
- number - text - email
27
Characteristics of Debug Logs
- the amount of information logged in the debug log can be controlled by the “log level” - to view Debug logs, “Manage Users” or “View All Data” permission is needed - Debug log levels are cumulative, where FINE log level includes all events logged at the DEBUG, INFO, WARN, and ERROR fields (NONE-→ERROR-→WARN-→INFO-→DEBUG-→FINE-→FINER-→FINEST)
28
which three data types can a SOQL query return?
- integer - sObject - List
29
how to use “External ID” to relate records:
-add related records by using a custom External ID field on the _parent record_
30
if you have more than one trigger that is defined on an object for the same event, can the order of execution be guaranteed?
NO, order of Execution cannot be guaranteed in this scenario
31
how does the _lightning component framework_ help developers implement solutions faster?
by providing device awareness for mobile and desktops \*\*keyword in the question was _Lightning Component Framework_
32
what is the purpose of Unit Tests (using the @isTest functionality)
verifying whether a particular piece of code is working properly
33
Getter & Setter method characteristics:
- _Getter_ methods return values from a controller. Every value that is calculated by a controller and displayed on a page must have a corresponding getter method, including any Boolean variables - _Setter_ methods pass user-specified values from page markup to a controller. Any setter methods in a controller are automatically executed before any action methods - _getter_ method is always required to access values from a controller, _setter_ method is not always necessary to pass values into a controller - no guaranteed order in which Apex methods (such as _getter_, _setter_) and variables are processed by a controller extension
34
characteristics in regards to governor limits of a execute() method of an Apex class the implements _Batchable Interface_
- the apex governor limits are reset for each iteration of the execute() method - the apex governor limits might be higher due to the asynchronous nature of the transaction
35
operations that can be performed using a formula field?
- displaying an image based on the opportunity amount - calcualting a score on a lead based on the information from another field
36
what do we use Apex _Getter_ and _Setter_ methods for?
when we want to refer to Apex class variables in a Visualforce page
37
which tools run a script that “deploys” to a sandbox?
- VSCode - SFDX CLI
38
which tools run a script that “deploys” to a sandbox?
- VSCode - SFDX CLI
39
max _recursive_ trigger stack depth? (governor limits)
16 stacks
40
what tools can you use for custom user interfaces in Salesforce Classic vs Lightning?
Salesforce Classic -→ Visualforce page Lightning -→ Lightning Component or Visualforce page (obviously lightning component is the preference)
41
phases in the Salesforce Aura Application Event propagation framework?
- Capture - Bubble - Default
42
where to find information about the status of batch or future events?
- Apex Flex Queue - Apex Jobs
43
what to remember when debugging a _database.insert()_ exception?
database.insert() has a return type of “_SaveResult_” that can be used for debugging
44
what happens when you try to assign a list variable to something that is not a list variable?
exception
45
Formula's characteristics:
- formulas can reference values in related objects - formulas are calculated at runtime and are not stored in the database
46
ways to ensure _field-level security_ is applied while using _Apex_?
- .stripInaccessible (\*\*\*\*preferred) - WITH SECURITY\_ENFORCED clause on SOQL - describefieldresult class and its method inAccessible
47
in a SOQL query if you don't generate/create an aggregate function an alias, what does the alias become
expri \*where _i_ denotes the order of the aggregated files with no explicit alias, i starts at 0 \*aggregate functions -→ AVG(),SUM(),MAX(),MIN(),COUNT(),COUNT\_DISTINCT()
48
steps that allow a custom SVG to be included in a Lightning web Component?
- Reference the getter in the HTML template - import the static resource and provide a getter for it in Javascript - upload the SVG as a static resource
49
which annotation exposes an Apex class as a RESTful web service?
@RestResource
50
Trigger “Best Practices” in Salesforce?
- one trigger per object - context-specific handler methods (or helper classes) - bulkify your code
51
techniques to prevent SOQL "injection"
**-String.escapeSingleQuotes()** **-static queries with Bind variables** - type casting - replacing characters - allowlisting
52
Test coverage standards:
**-75% code coverage on Apex classes** **-1% code coverage on Apex triggers(atleast one line of code for your trigger)** -75% code coverage across org(classes & triggers combined)
53
Governor Limits:
- 100 synchronous SOQL queries / 200 asynchronous SOQL queries - 150 DML statements - 20 SOSL queries (search terms) - 50000 records (retrieved by SOQL queries) - 10000 records (using Database. class functionality) - 2000 records (number of records retrieved by a single SOQL query) - 16 (recursive stack depth) - 100 HTTP callouts in a transaction
54
three lines of code required to create a Lightning component on a Visualforce page?
$Lightning.createComponent $Lightning.use
55
security consideration in regards to using _Lightning Data Service_?
-_lightning data service_ handles sharing rules and field-level security
56
which tool should a developer use to troubleshoot the causes of performance issues when a custom page loads in their org?
Developer console
57
Characteristics for Aura component events?
- event propagates to every owner in the containment heirarchey - if a container component needs to handle a component event, add a handleFacets="true" attribute to its handler
58
relationship queries use ? (related objects)
\_\_r \*child object is _plural_
59
sharing access to a junction object record is -→
determined by a user's sharing access to both associated master records
60
how to specify mock responses in _Testing HTTP Callouts in Apex_?
- by implementing the HttpCalloutMock interface (\*preferred) - by using static resources with StaticResourceCalloutMock
61
how to use _Callouts_ in triggers?
invoke callouts from triggers by encapsulating the callouts in @future methods \*Move the callout to an asynchronous method with @future(callout=true) annotation
62
what tool should you use to prevent a user from editing a field on a record after certain criteria are met?
validation rule
63
how can a developer check the test coverage of active process builder and flows before deploying them in a change set?
use SOQL and the Tooling API
64
things that present a security vulnerability on Visualforce pages and/or controllers?
-setting escape ="false" \*_escape_ should be set =_"true"_
65
which three items can a trace flag be configured for?
- Apex Class - Apex Trigger - User
66
characteristics of _exposing the Lightning Web Components_?
- IsExposed() attribute set to true on the XML file - specify the _Target_ where the component can be added(such as a lightning page)
67
what type of method can be called from a _Flow_?
@InvocableMethod
68
what should a developer use to script the deployment and unit test execution as part of continuous Integration?
Salesforce CLI
69
some operations that can affect the number of times a trigger can fire?
- workflow rules - flows - roll-up summary fields
70
_Execute Anonymous Block_ basic definition :
where Apex code can be ran that doesn't get stored as metadata, but that can be compiled and executed
71
what does the Lightning Component Framework provide to developers?
prebuilt components that can be reused
72
which sandbox type supports performance testing, load testing, and staging?
Full Sandbox
73
how should a custom user interface be provided when a user edits an Account in Lightning Experience?
Override the accounts edit button with a _Lightning Component_
74
to use **@wire** to call an Apex method -→
annotate method with **@AuraEnabled(cacheable=true)** \*method must be static, global, or public
75
which Visualforce feature supports a list button that will display a Visualforce page that allows users to edit multiple records?
RecordSetVar attribute
76
3 ways for a developer to execute tests in an org?
- setup menu - tooling API - Salesforce DX
77
how to monitor the progress of a _Queueable Apex_ job?
- Apex jobs page - query the AsyncApexJob object
78
benefits of using declarative customizations over code?
- generally require less maintenance - automatically update with each salesforce release - have more flexibility related to limits (not that they have different limits than code)
79
if a class doesn't DECLARE with sharing or without sharing -→
sharing is inherited
80
which sfdc commands can be used to add testing data to a Developer Sandbox?
- Force:data:bulk:upsert - Force:data:tree:import
81
Resources in an Aura component that can contain Javascript functions?
- Renderer - Controller - Helper
82
characteristics of _Custom Exceptions_ in Apex?
- class name must end with ‘Exception’ - custom exception class must extend the system Exception class - class can implement one or many interfaces
83
when testing using existing data in for example a sandbox for testing using (@isTest(SeeAllData=True)) what might happen?
test may FAIL in the _Test Framework_ because your using existing data
84
best practices when it comes to Aura component and application event handling?
- reuse the event logic in a component bundle, by putting the logic in the helper - handle low-level events in the event handler and re-fire them as higher-level events
85
which two settings must be defined in order to update a record of a _junction object_?
- read/write access on the primary relationship - read/write access on the secondary relationship
86
enforcing object and field-level permissions
look for “Schema” keyword and isUpdateable() -→ updating context isCreateable() -→ creating context isAccessible() -→ check permissions context isDeletable() -→ deleting context
87
field data types that can be _External Id_
- number - text - email
88
capabilities of the \<1tng:require\> tag when loading Javascript resources in Aura Components?
- specifying loading order - one-time loading for duplicate scripts - loading scripts in parallel
89
which salesforce feature allows a developer to see when a user last logged in to Salesforce if real-time notification is not required?
Event Monitoring Log
90
master-detail field from _______ to \_\_\_\_\_\_\_
master-detail field from **child** to **parent**
91
when using _Salesforce Dx_, what does a developer need to enable to create manage scratch orgs?
Dev Hub
92
the _Enhance Element_ from Einstein Best Action Returns a \_\_\_\_
list of recommendations -→ List\> \*must be called with an @InvocableMethod
93
what are two advantages of implementing the _view_ layer of a Salesforce application using Lightning Web Component based development _over_ Visualforce?
- rich component ecosystem - self-contained and reusable units of an application
94
how to back up all of the data and attachments in the Salesforce org once a month?
Data Export Scheduled job
95
code that displays the contents of a Visualforce page as a PDF
apex:page renderAs="pdf:
96
example of class the implement a custom _SOAP Web Service_
**global** class Webservice Class{ private Boolean helperMethod(){/\*implementation…\*/} **webservice** static String updateRecords(){/\*implementation…\*/}
97
to embed a flow in your Aura Component, add the
**lightning:flow** component to it
98
benefits of developing applications in a multi-tenant environment?
enforced best practices for development
99
Apex Interface characteristics:
- method implementation can be defined within the apex interface - apex class must be declared using the **interface** keyword - a method defined in an Apex Interface **cannot** have an **access modifier**
100
Salesforce resources that can be accessed from a _Lightning Web Component_
- static resources - SVG resources - Content asset files
101
which module provides access to methods for subscribing to a streaming channel and listening to event messages
lighting/empApi
102
how to find a users “default” record type?
Opportunity.SObjectType.getDescribe().getRecordTypeInfos() \*iterate thought them until isDefaultRecordTypeMapping() = true
103
standard apex:page configuration attributes
standardController extensions action
104
name some _asynchronous_ tools
- batchable - queuable - Bulk API
105
**Virtual** keyword
provide the derived classes with the option of _overriding_ them