I am trying to create a dynamic component and i am able to load "loadingSWQuotes" component successfully. I want to pass the quoteid as a parameter to the component.

init : function(component, event, helper) {
        var modalBody;
        var modalFooter;
        var quoteid = event.currentTarget.dataset.id;
        component.set("v.Quote_id", quoteid);
                    "aura:recordId": quoteid
         function(components, status){
             if (status === "SUCCESS") {
                 modalBody = components[0];
                     header: "Quotes",
                     body: modalBody,
                     footer: modalFooter,
                     showCloseButton: true,
                     cssClass: "my-modal,my-custom-class,my-other-class",
                     closeCallback: function() {

Component I have hard coded the record id in the component now. I want to pass it dynamically

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction"
                access="global" controller="FilesController">
    <!--<aura:attribute name="recordId" type="String"/>-->
    <aura:attribute name="filesIds" type="list"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="recordId" type="string" default="a0902000000IFmjAAG"/>

    <lightning:recordViewForm recordId="a0902000000IFmjAAG" objectApiName="Opportunity_Quotes__c" >
    <!--<lightning:recordEditForm objectApiName="Opportunity_Quotes__c" onsuccess="{!c.handleSuccess}">-->
        <lightning:messages />
         <lightning:outputField fieldName="QuoteId__c" />
         <lightning:outputField fieldName="Status__c" />
         <lightning:outputField fieldName="CurrMembers__c" />
         <lightning:outputField fieldName="FinalIncrease__c" />
         <lightning:outputField fieldName="FinalRev__c" />       

1 Answer 1


You have used aura:recordId, instead of that use only recordId

For passing values from your parent component you can use :

        "acc": "acc"
    function(newComp) {
        var content = component.find("body");
        content.set("v.body", newComp);

And define attribute in your created component to access it:

<aura:attribute name="acc" type="Account"/>

You must log in to answer this question.

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