wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Dev 1 / 16-3

Total questions: 12

Worksheet time: 7mins

Name
Class
Date
1.

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?

a)

There is no need, @AuraEnabled method automatically enforce FLS

b)

Use the Database.insertSecure() method

c)

Use the DescribeSObjectResult to check the user permissions for each populated field on the SObject

d)

Use the Security.stripInaccessible() method

2.

How can a developer declaratively access a specific custom metadata type (MyCustomMetadataType__mdt) record within Apex?

a)

MyCustomMetadataType__mdt.getRecord(‘Record_Name’);

b)

CustomMetadata.get(‘MyCustomMetadataType__mdt’).get(‘Record_Name’);

c)

MyCustomMetadataType__mdt.getInstance(‘Record_Name’);

d)

MyCustomMetadataType__mdt.(‘Record_Name’);

3.

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?

a)

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

b)

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

c)

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

d)

Add a field to each object for its legacy CRM Id, write an Apex trigger that on insert matches the record to its parent

4.

Which of the following uses the correct naming convention to be used for naming CustomEvent fired from Lightning Web Components using

dispatch event?

a)

onMyAction

b)

myAction

c)

my action

d)

my_action

5.

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?

a)

The deployment succeeds due to code coverage being above 75%

b)

The deployment succeeds due to the total number of lines covered by tests in the deployment being above 75%

c)

The deployment fails because the Apex trigger has 0% code coverage

d)

The deployment fails as the not every component in the deployment has 75% code coverage

6.

A developer wishes to add a picklist to a Lightning Web Component they are building. Which of the following snippets should they use?

a)

<lightning-input type=”combobox”></lightning-input>

b)

<lightning-input type=”picklist”></lightning-input>

c)

<lightning-combobox></lightning-combobox>

d)

<lightning-picklist></lightning- picklist >

e)

<lightning:combobox/ >

7.

How can we best reference external resources (e.g. CSS or JavaScript) within Lightning Components and Visualforce pages?

a)

Upload the resources to a CDN and reference them via link tags within our markup

b)

Upload them as Static Resources

c)

Upload them as External Resources

d)

Add links to our markup pointing to the external resources

8.

Which of the following code snippets correctly defines a new custom exception?

a)

public class MyCustomException implements Exception{}

b)

public class MyCustomException extends Exception{}

c)

public exception MyCustomException{}

d)

public class MyCustomExceptionClass extends Exception{}

9.

Which of the following statements are true about formula fields? (Choose 2)

a)

Formulas are calculated at access time

b)

Formulas are stored separately from the field themselves

c)

Formulas can span multiple objects

d)

Formulas don’t have a character limit

10.

A developer wishes to write a test for a private method within a class, how can this be best achieved?

a)

Write a test which executes the public method which calls the private method to be tested

b)

Annotate the private method with @TestVisible

c)

Annotate the test class with @Istest(seePrivate=true)

d)

Change the access modifier to be public

11.

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?

a)

Create a controller extension which queries the required details on Account

b)

Reference the Account fields using {!opportunity.Account.fieldName}

c)

Replace the standard controller with the standard relationship controller

d)

Write a custom controller to query all required records

12.

What would be the result of executing the following Apex test?

a)

The test would successfully run

b)

A “List has no rows for assignment to SObject” error would be thrown

c)

A “Index 0 is out of bounds” error would be thrown

d)

The System.assert() would fail