
Dev 1 - 31 onwards

Quiz
•
Business
•
1st Grade
•
Hard
Megan Santos
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
39. You have been requested to generate a simple PDF displaying line items for an Opportunity. How can you best achieve this?
Search for an App on the AppExchange
Create a Visualforce page with ‘renderAs=”pdf”’
Create a Lightning Web Component and call the renderAsPdf() method
Use a third party API
Answer explanation
Visualforce pages are the only on-platform technology that can be used to render PDFs, and since the PDF to be generated here is simple,
utilising this functionality is the best approach.
For more complex PDFs, utilising an AppExchange app would be preferred since it wouldn’t require developers to build something from scratch,
and instead would only require installing an App.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the value of “foo” after this following code has been executed?
10
20
30
40
Answer explanation
Switch statements allow a developer to test whether an expression matches one of several different values in a branch, and perform some code based on the matching branch.
In the question, the switch operation compares an Enum value against several options. Since the value operation is AFTER_INSERT, the switch statement evaluates each branch until it matches the AFTER_INSERT value, which executes the code block, which sets foo to equal 30.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would the value of the instance variable “foo” be after the third execution of the following batch class?
1
2
3
4
Answer explanation
The instance variable is initially initialised as 1 during the constructor of the batch class. This is then incremented by 1 for each execute method
run. Since this batch class also implements Database.Stateful, the instance variables of this class are preserved after each execute method call,
hence why the output value is 4.
4.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What are the valid target source pairs for a changeset deployment? (Choose 2)
Developer org – Production Org
Developer org – Sandbox
Sandbox – Sandbox
Sandbox – Production Org
Answer explanation
Changesets are only available within a production org and its sandboxes. The purpose of them is to allow development and testing to be done in
a metadata clone of a production org, and for those changes to be migrated into production when ready.
Since developer orgs are not tied to a production instance and are instead standalone, they do not feature changesets and so cannot be the
target nor the source of a changeset deployment
5.
MULTIPLE SELECT QUESTION
1 min • 1 pt
How can a developer execute an anonymous block of Apex code? (Choose 3)
• Use the “Execute Anonymous” functionality of the Developer Console
• Use the “Execute Anonymous” functionality within the Setup area
• Utilise the REST API “executeAnonymous” endpoint
• Use the Salesforce CLI “force:apex:execute” command
• Use the Salesforce CLI “force:apex:execute:anonymous” command
• Write a class with the @Anonymous annotation
• Use the “Execute Anonymous” functionality of the Developer Console
• Use the “Execute Anonymous” functionality within the Setup area
• Utilise the REST API “executeAnonymous” endpoint
• Use the Salesforce CLI “force:apex:execute” command
• Use the Salesforce CLI “force:apex:execute:anonymous” command
Answer explanation
Anonymous Apex code can be executed both on platform and off platform. On platform this is done directly in the Developer Console, utilising the Developer Console’s inbuilt functionality.
When we wish to run code off platform, there are several ways this can be achieved. One of the easiest is to utilise the Salesforce CLI commands, as these can run code directly from either a terminal, or from code stored within a file. Lastly we can utilise either the SOAP or the REST APIs to send code to Salesforce to be executed.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
You have an @AuraEnabled method which accepts an SObject from a Lightning Component which will be inserted, how can you easily sanitise
the user’s input?
There is no need, @AuraEnabled method automatically enforce FLS
Use the Database.insertSecure() method
Use the DescribeSObjectResult to check the user permissions for each populated field on the SObject
Use the Security.stripInaccessible() method
Answer explanation
The Security class methods are designed explicitly for easily enforcing the FLS of the current user by stripping anything which is not accessible in
the defined context.
While checking each field’s accessibility using the DescribeSObjectResult for the SObject is a valid approach, it is far more verbose and requires
a lot more code to achieve the same results as utilising the Security.stripInaccessible() methods.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How can a developer declaratively access a specific custom metadata type (MyCustomMetadataType__mdt) record within Apex?
MyCustomMetadataType__mdt.getRecord(‘Record_Name’);
CustomMetadata.get(‘MyCustomMetadataType__mdt’).get(‘Record_Name’);
MyCustomMetadataType__mdt.getInstance(‘Record_Name’);
MyCustomMetadataType__mdt.(‘Record_Name’);
Answer explanation
Each custom metadata type comes with its own SObject type in Apex. This type contains additional methods which can be used to declaratively
obtain records from a custom metadata type by developer name or record Id. These methods are similar to those found on custom settings.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Management Chapter 4

Quiz
•
1st - 3rd Grade
15 questions
QUIZ 4 : ACCOUNTING CYCLE

Quiz
•
1st Grade - University
15 questions
QUIZ 3 : TOPIC 11 [INCOMPLETE RECORDS & SINGLE ENTRY]

Quiz
•
1st Grade - University
14 questions
Dev 3/21

Quiz
•
1st Grade
10 questions
KUIS Sistem Manajemen Kepatuhan ISO 37301:2021

Quiz
•
1st Grade
10 questions
Basic Accounting

Quiz
•
1st - 10th Grade
13 questions
Test nhanh ict

Quiz
•
KG - Professional Dev...
13 questions
QUIZ 3 : ACCOUNTING FOR RECEIVABLES

Quiz
•
1st Grade - University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Business
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
18 questions
D189 1st Grade OG 1c Concept 37-38

Quiz
•
1st Grade
20 questions
addition

Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences

Quiz
•
1st - 3rd Grade
20 questions
Place Value

Quiz
•
KG - 3rd Grade
10 questions
Exploring Force and Motion Concepts

Interactive video
•
1st - 5th Grade
10 questions
Exploring Properties of Matter

Interactive video
•
1st - 5th Grade
5 questions
Sense and Response

Quiz
•
1st Grade