2

Trying to add a record action for a custom object using a Lightning Web Component, but I am getting this error:

enter image description here

This is my component meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>false</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
        <target>lightning__RecordPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>ScreenAction</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

2 Answers 2

8

You need to mark your component as exposed so you can see it in your org, so your xml file would look like this. Right now your isExposed tag is set to false, so until you set that to true it won't show up

<?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>ScreenAction</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

Hope that helps

2
  • Didn't work for me. The only difference is my component uses version 54 of the API.
    – Eric
    Sep 14, 2022 at 3:04
  • adding <target>lightning__RecordPage</target> is sufficient, no need for anything else
    – Json
    Jan 27, 2023 at 11:10
2

I had to add some tag inside of my template, like:

<template> 
     <p>test</p> 
</template>

alongside having all the other suggested changes to the target and targetconfigs. After I added that, it started showing up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .