You need to sign in to do that
Don't have an account?

How to delete a target property from config elements from lwc.
How to delete a target property from config elements from lwc.
for exx:
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="recordId" type="String" label="Record ID" default="{!recordId}" description="The value should be {!recordId}."/>
<property name="objectApiName" type="String" label="Object Name" description="Automatically bind the page's object name to the component variable"
default="{!objectApiName}" />
</targetConfig>
</targetConfigs>
i want to delete property objectApiName but when i remove code or delete from community page and publish that then also it return me errot that i can delete a config property,
for exx:
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="recordId" type="String" label="Record ID" default="{!recordId}" description="The value should be {!recordId}."/>
<property name="objectApiName" type="String" label="Object Name" description="Automatically bind the page's object name to the component variable"
default="{!objectApiName}" />
</targetConfig>
</targetConfigs>
i want to delete property objectApiName but when i remove code or delete from community page and publish that then also it return me errot that i can delete a config property,
First you need to remove thre reference of your page wherever it is used line record page, app Page or community then remove the property and deploy the updated code it will work.
If it helped then can you please mark it as the best answer so that it can be used by others in the future.
Regards,
Santosh Kumar
All Answers
First you need to remove thre reference of your page wherever it is used line record page, app Page or community then remove the property and deploy the updated code it will work.
If it helped then can you please mark it as the best answer so that it can be used by others in the future.
Regards,
Santosh Kumar
I found it useful to go to Setup > Lightning Components and select the component for which you want to change the targets. Click Delete. If there are any references to the component that would prevent changing the targets, you'll get a list of pages where the component is included. Click the link to each page, click Edit, which takes you into Lightning App Builder, then remove the component and save.