Font size
WorksheetsSalesforce - Platform Developer 1 Master Cheat Sheet
Total questions: 100
Worksheet time: 50mins
What is the correct order for exception handling syntax in Salesforce Apex?
Generic to Specific
Specific to Generic
In the following code snippet, which block is executed regardless of whether an exception is thrown? try { } catch(DmlException e) { // DmlException handling code here. } catch(Exception e) { // Generic exception handling code here. } finally { // Final code goes here }
try
catch
finally
What does the getCause() method return in exception handling?
The error message for the user
The cause of the exception as an exception object
The line number where the exception was thrown
The stack trace as a string
Which method returns the line number from where the exception was thrown?
getMessage
getLineNumber
getStackTraceString
getTypeName
Fill in the blank: The getMessage() method returns the ______ that displays for the user.
error message
success message
warning message
confirmation message
Which method returns the stack trace as a string?
getTypeName
getStackTraceString
getDmlFieldNames
getNumDml
What does the getTypeName() method return?
The number of failed records
The type of exception
The error message
The ID of the failed record
Fill in the blank: The getDmlFieldNames method returns the names of the fields that caused the ______ for the specified failed record.
error
update
success
rollback
Which method returns the ID of the failed record that caused the error for the specified failed record?
getDmlFieldNames
getDmlId
getDmlMessage
getNumDml
Fill in the blank: The getDmlMessage method returns the ______ for the specified failed record.
error message
record ID
success status
timestamp
Which method returns the number of failed records?
getDmlFieldNames
getDmlId
getNumDml
getTypeName
To create a custom exception in Salesforce, which class should you extend?
A) Exception
B) CustomException
C) Error
D) DmlException
Which of the following is NOT a standard trigger event in Salesforce?
before insert
before update
after undelete
before undelete
Fill in the blank: The syntax for a standard trigger in Salesforce is ___
trigger TriggerName on ObjectName (trigger_events) { code_block }
TriggerName trigger on ObjectName (trigger_events) { code_block }
on ObjectName trigger TriggerName (trigger_events) { code_block }
trigger on ObjectName TriggerName (trigger_events) { code_block }
You can use addError(errorMessage) on the Trigger object lists to add an error.
True
False
Which annotation is used to indicate that a class is a test class in Salesforce?
@TestClass
@isTest
@TestMethod
@Test
Fill in the blank: Minimum ____% test coverage is required to deploy to production in Salesforce.
75
50
60
90
All tests must pass in order to deploy to production in Salesforce.
True
False
Which of the following statements is correct about test methods in Salesforce?
Test methods can be non-static
Test methods must be static
Test methods must use the @Test annotation
Test methods must use the @TestClass annotation
Fill in the blank: The test classes don't count towards the ____ org code size limit in Salesforce.
3MB
1MB
5MB
10MB
The tests can have only one Test.startTest() and Test.stopTest() block in Salesforce.
True
False
What is the purpose of using the Schedulable interface in Apex?
To process batches asynchronously
To run Apex code at specific times
To implement triggers
To create custom objects
Which method is required to be implemented when using the Schedulable interface in Apex?
execute
start
run
process
What is the maximum number of classes that can be scheduled at one time using the Schedulable interface in Apex?
100
50
200
500
What does the following CRON expression represent? '0 0 0 15 3 ? 2022;'
Midnight on March 15, 2022
Noon on March 15, 2022
Midnight on January 1, 2022
Noon on January 1, 2022
When Test.StartTest() is used, the job runs immediately instead of waiting for Cron time.
True
False
Which setup item can be used to find currently scheduled jobs in Salesforce?
The Scheduled Jobs setup item
The Workflow Rules setup item
The Data Import Wizard setup item
The Email Templates setup item
What is the default batch size for Apex Batch Processing?
200
100
500
1000
Each batch in Apex Batch Processing is a ______ transaction.
discrete
continuous
shared
dependent
A batch class in Apex must implement which interface?
Database.Batchable
Schedulable
Iterable
Cloneable
What is the maximum number of records that can be returned in the Database.QueryLocator object?
5 million
50 million
500,000
1 million
Batches of records are guaranteed to execute in the order they are received from the start method.
True
False
Fill in the blank: Test methods can execute only ____ batch.
one
two
multiple
zero
Which method is used to execute a batch job in Salesforce Apex?
Database.runBatch
Database.executeBatch
Database.startBatch
Database.processBatch
In the provided code example, what is the purpose of the finish method in the batch class?
The finish method is called after all batches are processed and is used to send confirmation emails or execute post-processing operations.
The finish method is used to initialize the batch class before processing starts.
The finish method is responsible for dividing records into smaller batches.
The finish method is used to handle errors that occur during batch processing.
Which annotation is used to identify methods that run asynchronously in Apex?
@future
@async
@later
@thread
Future Methods in Apex must be static.
True
False
What type can Future Methods return?
String
Integer
Void
Boolean
Fill in the blank: You can't call one ______ method from another in Apex.
future
static
test
private
Which types of arguments are typically used for Future Methods in Apex?
Custom Objects
ID or List
String
Boolean
Future Methods are typically used for ______ to external Web services, Non-Immediate Resource intensive operations.
Callouts
Triggers
Validation Rules
Reports
Queueable Apex is similar to Future Methods but with some extra features. To use Queueable Apex, you must implement the ______ interface.
Queueable
Schedulable
Batchable
Iterable
Your Queueable class can contain member variables of non-primitive data types, such as sObjects or custom Apex types.
True
False
Queueable Apex returns an Id similar to Batch Apex to monitor the ______ Apex Job.
Async
Synchronous
Scheduled
Immediate
Can you chain a Queueable Apex from another Queueable Apex?
Yes
No
Which annotation is used to create a REST resource in Salesforce?
@RestResource
@RestAPI
@Restful
@Resource
What is the base URL for Salesforce REST resources?
https://instance.salesforce.com/services/restapi/
https://instance.salesforce.com/services/apexrest/
https://salesforce.com/api/
https://instance.salesforce.com/rest/
Fill in the blank: In Salesforce, the class must be ______ and the methods must be ______ ______ to create a REST resource.
global, global static
public, public static
private, private static
protected, protected static
In the provided code example, what is the value of 'inventory' in the input JSON?
100
1000
10
750
The workbench can be used to test REST APIs in Salesforce.
True
False
In order to use a Standard List controller, which attribute must be added to the
recordSetVar
tabStyle
rerender
pageMessages
Which tags create user interface elements that match the standard UI style in Visualforce?
The pageBlockSection tag has a ______ element which lets you set the number of columns in the section.
columns
rows
header
footer
What does the
A standard visualforce table
A button
A link
A template
The column tag creates a ______ in the table.
column
row
cell
border
The tabStyle attribute of
standardController
customController
recordType
actionFunction
The $User variable is used to:
Access user details
Display errors
Create templates
Link to another page
Which tag is used to display the standard view page for a record?
The relatedList tag is used to display ______ lists.
related
custom
static
primary
The rerender attribute is used on certain tags to ______ a section.
re-render
remove
refresh
hide
Which of the following is NOT a way to display visualforce?
Override Standard Pages
Embed a page in a standard layout
Create a button that links to a VF page
Use
$Page.pageName is used to get a link reference to ______.
another page
an image
a database
a stylesheet
Which tag is used to show errors in Visualforce?
To insert a placeholder in a template, which tag is used?
Which tag is used to include a page in another page in Salesforce Visualforce?
What is the purpose of the $Resource variable in Salesforce?
To access static resources
To define a page
To invoke a remote action
To format output text
Fill in the blank: Use VisualForce.remoting.Manager.invokeAction('{!$RemoteAction.ClassName.MethodName}') to ________.
invoke a remote action
create a new VisualForce page
delete a record
refresh the browser
Which of the following is used to format an output text in currency format in Salesforce Visualforce?
Which of the following is NOT a step in the typical Development Lifecycle for Developing in Production?
A) Plan functional requirements
B) Create a development environment
C) Update profiles to reveal your changes
D) Notify end users of changes
List two ways of migrating changes between Sandboxes and Production in Salesforce.
Change Sets, ANT Migration Toolkit
Data Loader, Reports
Workflow Rules, Validation Rules
Apex Triggers, Visualforce Pages
Custom Objects, Profiles
What does a Developer sandbox copy in Salesforce?
A Developer sandbox copies customization (metadata), but doesn't copy production data, into a separate environment for coding and testing.
A Developer sandbox copies both customization (metadata) and production data into the same environment.
A Developer sandbox only copies production data and ignores customization (metadata).
A Developer sandbox copies user profiles and permissions, but not customization (metadata) or production data.
What is the main difference between a Developer sandbox and a Developer Pro sandbox in Salesforce?
Developer Pro sandboxes have more storage than Developer sandboxes and may include a number of Developer sandboxes, depending on the edition of your production organization.
Developer sandboxes have more storage than Developer Pro sandboxes and may include a number of Developer Pro sandboxes, depending on the edition of your production organization.
Developer Pro sandboxes have less storage than Developer sandboxes and do not include any Developer sandboxes.
There is no difference between Developer sandbox and Developer Pro sandbox in terms of storage or features.
What does a Partial Copy sandbox include in Salesforce?
A Partial Copy sandbox is a Developer sandbox plus the data that you define in a sandbox template.
A Partial Copy sandbox includes only metadata and no data.
A Partial Copy sandbox is a Full sandbox with all data and attachments.
A Partial Copy sandbox contains only standard Salesforce objects.
What does a Full Copy sandbox copy in Salesforce?
A Full Copy sandbox copies your entire production organization and all its data, including standard and custom object records.
A Full Copy sandbox only copies the metadata and no data from production.
A Full Copy sandbox copies only custom object records, not standard object records.
A Full Copy sandbox copies only user accounts and profiles, excluding other data.
What type of sandbox should be used for production debugging?
Full Copy Sandbox
Developer Sandbox
Partial Copy Sandbox
Developer Pro Sandbox
Which sandbox is best for testing external integrations when an external system expects full production data to be present?
Full sandbox
Developer sandbox
Partial Copy sandbox
Developer Pro sandbox
For unit tests and Apex tests, which sandboxes can be used?
Developer or Developer Pro sandbox
Partial Copy sandbox
Full sandbox
Production environment
When should you use web-based importing in Salesforce?
When you are loading less than 50,000 records, the object is supported by import wizards, or you want to prevent duplicates by uploading records according to account name and site, contact email address, or lead email address.
When you are importing more than 100,000 records and need advanced data transformation.
When you want to update records using external IDs only.
When you need to schedule regular imports automatically.
When should you use Data Loader in Salesforce?
When you need to load 50,000 to 5,000,000 records, need to load into an object not supported by import wizards, want to schedule regular data loads, or want to export your data for backup purposes.
When you need to update a single record manually.
When you want to customize the Salesforce user interface.
When you need to create reports and dashboards.
What is the maximum number of records supported by Data Loader for loading?
5,000,000 records
500,000 records
1,000,000 records
10,000,000 records
What should you plan your release around in the process of developing applications in a release train?
Salesforce upgrades
Team vacations
Budget reviews
Customer feedback sessions
Which of the following determines the best index from which to drive the query, if possible, based on filters in the query?
Skinny Tables
Force.com query optimizer
Indexes
Custom objects
Fill in the blank: Skinny Tables are copies of the data for a table with a limited number of fields (____ columns).
100
10
50
200
Which of the following statements about Skinny Tables is TRUE?
They are not kept in sync with the source data
They help in fast data access
They can contain fields from multiple objects
They do not need to be enabled by support
Fill in the blank: Custom indexes can be created to optimize ________.
performance
security
storage
design
Which indexes are created by default in Salesforce?
RecordTypeId, Division, CreatedDate, Name, Email
AccountId, OpportunityId, LastModifiedDate, Phone, Address
LeadSource, OwnerId, Status, Industry, Website
ContactId, CaseNumber, Priority, Description, Type
Skinny Tables can only contain fields from the base object.
True
False
Which of the following is NOT a function of the Force.com query optimizer?
Updates statistics
Determines how to order the remaining tables to minimize cost
Creates custom indexes
Injects custom foreign key value tables as needed to create efficient join paths
Fill in the blank: The Force.com query optimizer influences the execution plan for the remaining joins, including sharing joins, to minimize database ________.
input/output (I/O)
latency
bandwidth
storage
Indexes for External Id are created by default.
True
False
By default, nulls are not considered in the index.
True
False
If a where clause narrows down the criteria to ___% for Standard fields or ___% for Custom fields, the index is used.
30% for Standard fields, 10% for Custom fields
50% for Standard fields, 20% for Custom fields
40% for Standard fields, 15% for Custom fields
25% for Standard fields, 5% for Custom fields
Formula fields which are deterministic are indexed.
True
False
A formula field is deterministic if it does not use TODAY(), NOW(), etc.
True
False
A formula field is deterministic if it does not refer to a different object.
True
False
Two column indexes can be created for supporting search + sort. These are more efficient than 2 indexes.
True
False
Divisions can be used to partition huge volumes of data by ________.
business unit
color code
alphabetical order
random selection
What is the maximum number of triggers that can be defined on a single object in Salesforce?
50
20
Unlimited
10
Which context variable provides the list of records that are being processed in a trigger?
Trigger.isInsert
Trigger.isUpdate
Trigger.new
Trigger.old
What is the purpose of the 'after' trigger in Apex?
To prevent record deletion
To validate data before saving
To perform actions after the record is saved
To perform actions before the record is saved
