• leduc dat
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi  all,
I am having an issue with saving record of lightning:recordEditForm with nested component.
I have component A which will display content depending on currentuserID. In this case, component A will call component B to open a new modal popup. The problem occurs when I press the save button, it shows a windows message like below image.
I tested component B by overriding 'new' standard action, but no errors occurred and record is saved.
So, I think component B doesn't work when nested in another component, but I don't know how to fix it properly.
I'm new to aura so I don't understand it very well.
Someone please help me. Thank you
--------------Component A( testNestedComponent.cmp)----------------------------------
<aura:component implements="lightning:actionOverride,force:hasRecordId,force:hasSObjectName">
	<!-- attributes -->
	<aura:attribute name="checkUser" type="Boolean" default="true" />
	<aura:attribute name="userId" type="User" />
	<!-- handlers-->
	<aura:handler name="init" value="{! this }" action="{! c.init }" />
	<aura:if isTrue="{!v.checkUser}">
		<lightning:listView aura:id="listViewDoctors" objectApiName="DoctorPersonalInfo__c" listName="AllDoctorPersonalInfo"
			rows="10" showSearchBar="true" showActionBar="false" enableInlineEdit="false" showRowLevelActions="false" />
	<aura:set attribute="else">
		<c:createNewDoctorPopupModal />
	</aura:set>
	</aura:if>
</aura:component>
 
-----------------Component B( createNewDoctorPopupModal.cmp)-------------------
<aura:component controller="createNewDoctor_Apex"
  implements="force:hasRecordId,flexipage:availableForAllPageTypes,lightning:actionOverride,force:lightningQuickAction">
  <lightning:workspaceAPI aura:id="workspace" />
  <aura:attribute name="loading" type="Boolean" default="false" />
  <aura:attribute name="isModalOpen" type="boolean" default="true" />

  <aura:handler name="init" value="{!this}" action="{!c.init}" />
  <div class="slds-m-around_xx-large">
    <aura:if isTrue="{!v.isModalOpen}">
      <lightning:recordEditForm objectApiName="DoctorPersonalInfo__c" aura:id="newRecordDoctorInfo"
        onsuccess="{!c.handleSuccess}" onsubmit="{!c.handleSubmit}" onerror="{!c.handleError}" onload="{!c.handleLoad}">
        <lightning:messages aura:id="OppMessage" />
        <!-- Modal/Popup Box starts here-->
        <section role="dialog" tabindex="-1" aria-hidden="false" aria-labelledby="modal-heading-01" aria-modal="true"
          aria-describedby="modal-content-id-1" class="slds-modal slds-backdrop_open">
          <div class="slds-modal__container">
            <!-- Modal/Popup Box Header Starts here-->
            <header class="slds-modal__header">
              <lightning:buttonIcon iconName="utility:close" onclick="{! c.closeModel }" alternativeText="close"
                variant="bare-inverse" class="slds-modal__close" />
              <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{!'新規 医師情報'} </h2>
            </header>
            <!--Modal/Popup Box Body Starts here-->
            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
              <div class="slds">
                <div class="row">

                  <div class="slds-section__title slds-theme_shade" style="padding: 3px;">
                    <h3 style="font-size: 1rem;" title="">Information</h3>
                  </div>
                  <div class="slds-grid">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large ">
                      <lightning:inputField class=".slds-size_1-of-2" fieldName="doctorName__c"
                        aura:id="newDoctorInfoField" />
                    </div>
                  </div>
                  <div class="slds-grid">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large ">
                      <lightning:inputField class=".slds-size_1-of-2" fieldName="doctorGender" aura:id="newDoctorInfoField"
                        required="true" />
                    </div>
                  </div>
				  
                </div>
              </div>
            </div>
            <!--Modal/Popup Box Footer Starts here-->
            <footer class="slds-modal__footer">
              <lightning:button variant="neutral" label="Cancel" title="Cancel" onclick="{! c.closeModel }" />
              <lightning:button variant="brand" label="Save" title="OK" type="submit" />
              <!-- onclick="{!c.submitDetails}" -->
            </footer>
          </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
        <aura:if isTrue="{!v.loading}">
          <lightning:spinner alternativeText="Loading" />
        </aura:if>
      </lightning:recordEditForm>
    </aura:if>
  </div>
</aura:component>

 
I want to show a related list view of the Student__c custom object which has Student__c.className__c = Class__c.id from the Class__c custom object, but the related list not showing up and i got this error : "Unfortunately, the related list you're trying to view isn't in the layout. Please get in touch with your administrator." Please help me or let me know what i was wrong. Any help will be appreciated.
var relatedListEvent = $A.get("e.force:navigateToRelatedList");
    relatedListEvent.setParams({
        "relatedListId": "Student__c.className__c",
        "parentRecordId": component.get("v.recordId") //recordId = Class__c.id 
    });
    relatedListEvent.fire();

 
Hi  all,
I am having an issue with saving record of lightning:recordEditForm with nested component.
I have component A which will display content depending on currentuserID. In this case, component A will call component B to open a new modal popup. The problem occurs when I press the save button, it shows a windows message like below image.
I tested component B by overriding 'new' standard action, but no errors occurred and record is saved.
So, I think component B doesn't work when nested in another component, but I don't know how to fix it properly.
I'm new to aura so I don't understand it very well.
Someone please help me. Thank you
--------------Component A( testNestedComponent.cmp)----------------------------------
<aura:component implements="lightning:actionOverride,force:hasRecordId,force:hasSObjectName">
	<!-- attributes -->
	<aura:attribute name="checkUser" type="Boolean" default="true" />
	<aura:attribute name="userId" type="User" />
	<!-- handlers-->
	<aura:handler name="init" value="{! this }" action="{! c.init }" />
	<aura:if isTrue="{!v.checkUser}">
		<lightning:listView aura:id="listViewDoctors" objectApiName="DoctorPersonalInfo__c" listName="AllDoctorPersonalInfo"
			rows="10" showSearchBar="true" showActionBar="false" enableInlineEdit="false" showRowLevelActions="false" />
	<aura:set attribute="else">
		<c:createNewDoctorPopupModal />
	</aura:set>
	</aura:if>
</aura:component>
 
-----------------Component B( createNewDoctorPopupModal.cmp)-------------------
<aura:component controller="createNewDoctor_Apex"
  implements="force:hasRecordId,flexipage:availableForAllPageTypes,lightning:actionOverride,force:lightningQuickAction">
  <lightning:workspaceAPI aura:id="workspace" />
  <aura:attribute name="loading" type="Boolean" default="false" />
  <aura:attribute name="isModalOpen" type="boolean" default="true" />

  <aura:handler name="init" value="{!this}" action="{!c.init}" />
  <div class="slds-m-around_xx-large">
    <aura:if isTrue="{!v.isModalOpen}">
      <lightning:recordEditForm objectApiName="DoctorPersonalInfo__c" aura:id="newRecordDoctorInfo"
        onsuccess="{!c.handleSuccess}" onsubmit="{!c.handleSubmit}" onerror="{!c.handleError}" onload="{!c.handleLoad}">
        <lightning:messages aura:id="OppMessage" />
        <!-- Modal/Popup Box starts here-->
        <section role="dialog" tabindex="-1" aria-hidden="false" aria-labelledby="modal-heading-01" aria-modal="true"
          aria-describedby="modal-content-id-1" class="slds-modal slds-backdrop_open">
          <div class="slds-modal__container">
            <!-- Modal/Popup Box Header Starts here-->
            <header class="slds-modal__header">
              <lightning:buttonIcon iconName="utility:close" onclick="{! c.closeModel }" alternativeText="close"
                variant="bare-inverse" class="slds-modal__close" />
              <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{!'新規 医師情報'} </h2>
            </header>
            <!--Modal/Popup Box Body Starts here-->
            <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
              <div class="slds">
                <div class="row">

                  <div class="slds-section__title slds-theme_shade" style="padding: 3px;">
                    <h3 style="font-size: 1rem;" title="">Information</h3>
                  </div>
                  <div class="slds-grid">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large ">
                      <lightning:inputField class=".slds-size_1-of-2" fieldName="doctorName__c"
                        aura:id="newDoctorInfoField" />
                    </div>
                  </div>
                  <div class="slds-grid">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large ">
                      <lightning:inputField class=".slds-size_1-of-2" fieldName="doctorGender" aura:id="newDoctorInfoField"
                        required="true" />
                    </div>
                  </div>
				  
                </div>
              </div>
            </div>
            <!--Modal/Popup Box Footer Starts here-->
            <footer class="slds-modal__footer">
              <lightning:button variant="neutral" label="Cancel" title="Cancel" onclick="{! c.closeModel }" />
              <lightning:button variant="brand" label="Save" title="OK" type="submit" />
              <!-- onclick="{!c.submitDetails}" -->
            </footer>
          </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
        <aura:if isTrue="{!v.loading}">
          <lightning:spinner alternativeText="Loading" />
        </aura:if>
      </lightning:recordEditForm>
    </aura:if>
  </div>
</aura:component>