
Dev 1 - 31 onwards
Authored by Megan Santos
Business
1st Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
SNOM Annual Dinner Quiz 2022
Quiz
•
1st Grade
10 questions
Consumer Agencies and Institutions
Quiz
•
1st Grade
10 questions
Government Intervention
Quiz
•
KG - Professional Dev...
10 questions
Do you SMART enough?
Quiz
•
KG - 1st Grade
10 questions
Agile Enablement for Frontrunner
Quiz
•
1st - 5th Grade
10 questions
methods of production
Quiz
•
1st - 3rd Grade
10 questions
Richest and popular things and persons
Quiz
•
1st Grade - Professio...
15 questions
Ethical Business
Quiz
•
KG - 1st Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade