wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LWC Sessions Quiz 3

Total questions: 14

Worksheet time: 8mins

Name
Class
Date
1.

How you write Expression in LWC HTML?

a)

LWC:If="{propertyName}"

b)

LWC:If={propertyName}

c)

LWC:If={!propertyName}

d)

LWC:If="{!propertyName}"

2.

What are the Files we can have in LWC Folder (multiple answers)

a)

Template

b)

CSS

c)

Meta File

d)

JavaScript

3.

In LWC, the easiest way to work with salesforce data is to use ____?

Which is built on lightning data service.

a)

Base Lightning Component

b)

Apex

c)

API callouts

4.

Import Apex Method in LWC: Is the below syntax Correct?

import apexMethodName from '@salesforce/apex/Classname.apexMethodReference';

a)

YES

b)

NO

5.

To expose an Apex method to a Lightning web component,

the method must be static and either global or public. And method must be annotate with?

a)

@EnableAura

b)

@AuraEnable

c)

@LWCEnabled

d)

@AuraEnabled

6.

To access object and field API names, use an import statement.

All object and field imports come from

a)

@salesforce/schema

b)

@salesforce/Apex

c)

lightning/schema

7.

To trigger a toast from a Lightning web component, in the component’s JavaScript class,

import {?????} from 'lightning/platformShowToastEvent';

a)

getRecords

b)

getRecord

c)

ShowToastEvent

8.

To trigger a toast for error, what variant value to pass in the ShowToastEvent.

a)

error

b)

warning

c)

success

d)

Info

9.

In the Toast Event parameters if you don't pass the variant value. What will be its

default value taken from the following?

a)

error

b)

warning

c)

success

d)

Info

10.

To render HTML conditionally, what directive to select from the following in the template tag.

a)

LWC:If

b)

If:LWC

c)

If={property}

11.

The getRecord is used to query a record from the Salesforce database,

this method takes how many parameters?

a)

1 RecordId

b)

2 RecordId and Fields

c)

None

12.

How many ways are there to call Apex method from Lightning Web Component:

a)

Two

b)

one

c)

Three

13.

Lightning data service is built on the top of User Interface API.

a)

TRUE

b)

FALSE

14.

Lightning Data Service handles sharing rules and field-level security for you.

In addition to simplifying access to Salesforce data.

a)

TRUE

b)

FALSE