You need to sign in to do that
Don't have an account?
sanca
how to get the recordid in the component which is invoked through quick action present in record page
Hi Devs ,
I have a component which is invoked through quick action present in event record page .The component is referring to force:hasRecordId interface .
The value of recordid is resulting to undefined when debugged.
<!--component>
<aura:component controller="customLookUpController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>
<!--controller>
({
doInit: function(component,event,helper) {
var getId = component.get("v.recordId"); -- > undefined
},
})
I have a component which is invoked through quick action present in event record page .The component is referring to force:hasRecordId interface .
The value of recordid is resulting to undefined when debugged.
<!--component>
<aura:component controller="customLookUpController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>
<!--controller>
({
doInit: function(component,event,helper) {
var getId = component.get("v.recordId"); -- > undefined
},
})
All Answers
Tried explicity declaring recordId , no luck ..
Just FYI , The component where i am trying to fetch the id is the child of component invoked from the quik action .
Apologize for not mentioning this earlier . Will this scenario cause the issue ?
Appreciate if any leads on this ..
Thanks for the inputs ,It worked like a charm .. :)
Nanni
Could you please post the worked solution in this thread. We're also facing similar kind of issue.
Thanks,
Govindaraj.S
<aura:component description="Aura Container in Utility Bar for LWC cmp"
implements="force:hasRecordId, force:lightningQuickAction, lightning:utilityItem" access="global">
<c:childLwcCmp recordId="{!v.recordId}" />
</aura:component>
<!--child LWC Cmp-->
export default class childLwcCmp extends LightningElement {
_recordId;
@api
get recordId() {
return this._recordId;
}
set recordId(value) {
this.setAttribute('recordId', value);
this._recordId = value;
//for the first time NULL comes, but then immediately the current recordID comes from the aura
if (this.recordId == null) {
console.log('-/-NULL-/-', this.recordId);
} else {
this.doInit();
}
}