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?
Dev 1 / 16-3
Quiz
•
Business
•
1st Grade
•
Hard
Megan Santos
Used 1+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 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.
2.
MULTIPLE CHOICE QUESTION
30 sec • 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.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You have been tasked with importing data from a legacy CRM system into a new Salesforce org. The legacy CRM system had database tables
analogous to the Account, Contact and Opportunity objects within Salesforce. How could you best ensure the relationships are preserved during
this data migration?
Add fields flagged as external Ids for each of the objects to be imported, populated with its legacy CRM Id, use the Data Loader tool,
and set the relationship fields to match these external Ids
Add fields flagged as external Ids for each of the objects to be imported, populated with its legacy CRM Id, write a script to re-establish
relationships after import
Add a field to each object for its legacy CRM Id, after importing each object, export them and use a VLOOKUP function in Excel to
match the Ids
Add a field to each object for its legacy CRM Id, write an Apex trigger that on insert matches the record to its parent
Answer explanation
External Ids allow flagging a field as an Id which is used within an external system. This allows the field to be utilised in Upsert calls, where
instead of specifying the Salesforce Id for a relationship field, the external Id can be used instead. The external Id is then used to find the record
within Salesforce and the relationship field value gets replaced with its Salesforce Id instead. This type of operation is supported by the Data
Loader tool.
Utilising manual methods of doing this match introduces the risk of human error when re-establishing the relationships.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following uses the correct naming convention to be used for naming CustomEvent fired from Lightning Web Components using
dispatch event?
onMyAction
myAction
my action
my_action
Answer explanation
The naming scheme for events within Lightning Web Components follows the DOM event standard. This means that all event names must not
use uppercase letters, have no spaces, and use underscores to separate words.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A developer creates an Apex trigger which calls a method within another class. A test has been written which directly calls the method within the
class and provides 100% code coverage. There are no other Apex classes present within the org. What would be the result of deploying a
changeset with this trigger and classes into production with running all tests?
The deployment succeeds due to code coverage being above 75%
The deployment succeeds due to the total number of lines covered by tests in the deployment being above 75%
The deployment fails because the Apex trigger has 0% code coverage
The deployment fails as the not every component in the deployment has 75% code coverage
Answer explanation
When doing a deployment into production, there must be an average of 75% code coverage for all Apex code within the org. Alongside this, Apex triggers being deployed must have at least 1 line being covered (i.e. they must have been called by at least one test class).
When running deployments, there is the option to run a subset of tests which changes the code coverage behaviour. When running the default testing mode, all tests are executed and the total coverage in an org must meet 75%. However, when running a specified set of tests, every item in the deployment must average 75% instead.
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
A developer wishes to add a picklist to a Lightning Web Component they are building. Which of the following snippets should they use?
<lightning-input type=”combobox”></lightning-input>
<lightning-input type=”picklist”></lightning-input>
<lightning-combobox></lightning-combobox>
<lightning-picklist></lightning- picklist >
<lightning:combobox/ >
Answer explanation
The LWC framework follows the HTML specification for how it expects HTML to be written within component templates. This means that for any
components that aren’t base HTML tags, it is required that no component tags are self-closing (i.e., there is always an explicit closing tag).
In LWC, when we wish to display picklists, we should utilise the base component called combobox. In Aura, we can either use the combobox or
the select components, however in LWC we only have the combobox as there is no lightning-select component.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can we best reference external resources (e.g. CSS or JavaScript) within Lightning Components and Visualforce pages?
Upload the resources to a CDN and reference them via link tags within our markup
Upload them as Static Resources
Upload them as External Resources
Add links to our markup pointing to the external resources
Answer explanation
Whenever we wish to use external resources within our application, we should upload them as Static Resources. Uploading the files as Static
Resources improves our applications security, as it shifts the control of the resources to be ours, instead of a third-party site which could end up
having malicious code embedded without our knowing.
Lightning Components require all third-party resources to be uploaded as Static Resources and loaded through the Platform Resource Loader,
however Visualforce can reference external URLs.
10 questions
TIME VALUE OF MONEY
Quiz
•
1st - 2nd Grade
10 questions
E-commerce
Quiz
•
1st - 3rd Grade
14 questions
Dev 1 full dump
Quiz
•
1st Grade
9 questions
These are a few of our favorite things....
Quiz
•
1st - 5th Grade
10 questions
Internalisasi DBHCHT
Quiz
•
1st Grade
12 questions
Fundamentals of law
Quiz
•
1st - 12th Grade
17 questions
ACG quiz
Quiz
•
1st Grade
10 questions
MKT243 ( Chapter 1&2)
Quiz
•
1st - 5th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
10 questions
Identifying equations
Quiz
•
KG - University
25 questions
2.4A Add Subtract within 20 quickly: set 3
Quiz
•
1st - 3rd Grade
15 questions
Music 2016
Quiz
•
KG - 12th Grade
12 questions
Summer Trivia
Quiz
•
1st - 5th Grade
44 questions
logos
Quiz
•
KG - University
20 questions
Guess that Disney
Quiz
•
KG - 5th Grade
20 questions
Cartoon Characters!
Quiz
•
KG - 5th Grade