Newer Version Available

This content describes an older version of this product. View Latest

Create a Quick Action with an LWC

Quick actions are an easy way to add and launch your Lightning web components. It’s simple to add them to the Test Harness app.

To create a Quick Action with an LWC, the LWC must have a target of type lightning__RecordAction defined in the component’s meta.xml file:

1<?xml version="1.0" encoding="UTF-8"?>
2  <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3    <apiVersion>59.0</apiVersion>
4    <isExposed>true</isExposed>
5    <targets>
6      <target>lightning__AppPage</target>
7      <target>lightning__HomePage</target>
8      <target>lightning__RecordAction</target>
9    </targets>
10  </LightningComponentBundle>

After a component is deployed to Salesforce, create a Quick Action that uses it. For details, see Quick Actions in the Lightning Web Components Developer Guide.

You don’t need to add Quick Actions to a page layout to see it in Test Harness. The Test Harness app automatically shows all LWC-based Quick Actions for the displayed sObject type.

Tip