• Jasiel Lora 8
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello,

I've been looking into created a custom lightning componenet for related records. My use case is I have an object called Checklist, on checklist there is a lookup to an object called Submittal and on submittal there is a lookup to an object called Listing.

I want to display the listing details when on the checklist object. I've looked into recordViewForms but they don't support displaying this relationship and was hoping someone could point me in the right direction as I can't find anything online for where to get started.
Hello,

I've created a a lightning component to display related record details. The ojbect I'm displaying the componenet on is Checklist__c, checklist has a related record called Submittal and submittal has a related record called Listing. I want to display the details of Listing__c on Checklist__c but can't figure out how to display records using recordviewform without hard coding the ID. I want this to display the listing related to the checklist, not just the same listing every time.

componenet:
<aura:component implements="flexipage:availableForAllPageTypes,force:appHostable,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName" access="global" >
    <aura:attribute name="sObjectName" type="String" />

    <lightning:card iconName="custom:custom19" title="Listing Details">
              
        <div class="slds-p-left_large slds-p-right_medium">    
            <lightning:recordForm aura:id="recordViewForm" 
                                  objectApiName="TRHC__Job__c"
                                  columns="2"
                                  recordId= "a1S1k000000VXlLEAW"
                                  layoutType ="Full"
                                  mode="readonly"
                                  onload="{!c.onLoad}"
                                  onerror="{!c.onError}"
                                  />   
        </div>
    </lightning:card>
    
</aura:component>


Controller:
({
    onLoad : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Loaded!",
            "message": "The record has been Loaded successfully ."
        });
        toastEvent.fire();
    },
    onError : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Error!",
            "message": "Error."
        });
        toastEvent.fire();
    }
    
    
})

 
Hello,

I've been looking into created a custom lightning componenet for related records. My use case is I have an object called Checklist, on checklist there is a lookup to an object called Submittal and on submittal there is a lookup to an object called Listing.

I want to display the listing details when on the checklist object. I've looked into recordViewForms but they don't support displaying this relationship and was hoping someone could point me in the right direction as I can't find anything online for where to get started.