function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Terence VibanTerence Viban 

Headless Quick Action For a LWC - You can only create Quick Actions with actionSubtype matched with the Lightning Web Component you defined

 Hi there,
I have created an LWC and wanted to create a headless Quick Action that uses it. I get the following error - "You can only create Quick Actions with actionSubtype matched with the Lightning Web Component you defined"
User-added imageThis action was previously created and worked flawlessly. Then a colleague deleted it and now I cannot recreate it again. Nothing has changed in the definition of the LWC or in the LWC itself.

This is what the definition looks like;
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
        <target>lightning__RecordPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>Action</actionType>
        </targetConfig>
        <targetConfig targets="lightning__RecordPage">
            <supportedFormFactors>
                <supportedFormFactor type="Small" />
                <supportedFormFactor type="Large" />
            </supportedFormFactors>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

And also the invoke method is in place
 
@api invoke () {
    this.isAction = true;
    this.showButton = false;
    if(this.recordId && this.objectApiName) this.performHlsCheck();
}

As I mentioned above, this worked previously before it was deleted. Also it is being used flawlessly on other objects as a quick action. Anyone has any ideas? thanks in advance
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Terence,

I hope lightning__RecordPage is not supported for Action type so it is causing the issue. After commenting those lines it is working as expected.
 
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__RecordAction</target>
<!-- <target>lightning__RecordPage</target>-->
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordAction">
<actionType>Action</actionType>
</targetConfig>
<!-- <targetConfig targets="lightning__RecordPage">
<supportedFormFactors>
<supportedFormFactor type="Small" />
<supportedFormFactor type="Large" />
</supportedFormFactors>
</targetConfig>-->
</targetConfigs>
</LightningComponentBundle>

If this solution helps, Please mark it as best answer.

Thanks,