I have a requirement to validate a few fields before submitting the record. I have created an Aura component and calling the LWC code to do some validation.
Aura Cmp:
<aura:component implements="flexipage:availableForRecordHome,force:lightningQuickActionWithoutHeader, force:hasRecordId">
Record ID: {!v.recordId}
<c:submitButton recordId="{!v.recordId}" />
</aura:component>
Lightning code:
import { LightningElement, api } from 'lwc';
export default class SubmitButton extends LightningElement {
@api recordId;
connectedCallback()
{
alert('Record ID'+recordId);
}
}
Output:
My issue is:
- I am not able to see the alert message which I have in LWC component
- I don't want to see this Aura component when Submit Button is clicked.
what is the mistake I did?