WorksheetsDev 1 / 16-3
Total questions: 12
Worksheet time: 7mins
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
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’);
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
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
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
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/ >
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
Which of the following code snippets correctly defines a new custom exception?
public class MyCustomException implements Exception{}
public class MyCustomException extends Exception{}
public exception MyCustomException{}
public class MyCustomExceptionClass extends Exception{}
Which of the following statements are true about formula fields? (Choose 2)
Formulas are calculated at access time
Formulas are stored separately from the field themselves
Formulas can span multiple objects
Formulas don’t have a character limit
A developer wishes to write a test for a private method within a class, how can this be best achieved?
Write a test which executes the public method which calls the private method to be tested
Annotate the private method with @TestVisible
Annotate the test class with @Istest(seePrivate=true)
Change the access modifier to be public
You have a Visualforce page displaying an Opportunity record. You wish to display details about the Account record linked to this Opportunity.
This page utilizes the standard controller. How could you add the Account name to the page?
Create a controller extension which queries the required details on Account
Reference the Account fields using {!opportunity.Account.fieldName}
Replace the standard controller with the standard relationship controller
Write a custom controller to query all required records
What would be the result of executing the following Apex test?
The test would successfully run
A “List has no rows for assignment to SObject” error would be thrown
A “Index 0 is out of bounds” error would be thrown
The System.assert() would fail
