function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lek LextechLek Lextech 

Can force:recorddata Lightning Data Service can retrive Record Type Name of Record Id?

Hi all, I try to use force:recorddata to retrive field data from record Id, it even work well to retrive relationship field value, but not for Record Type Name when I use {!v.recordField.RecordType.Name}, it return NULL value. How can I retrive Record Type Name without using Apex?

This is my component code:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <aura:attribute name="record" type="Object" />
    <aura:attribute name="recordField" type="Object" />
    <aura:attribute name="recordError" type="String" />
    <aura:attribute name="recordId" type="Id"  />

<force:recordData aura:id="recordEditor"
    layoutType="FULL"
    recordId="{!v.recordId}"
    targetError="{!v.recordError}"
    targetRecord="{!v.record}"
    targetFields="{!v.recordField}"
    mode="EDIT" />

                {!v.recordField.RecordTypeId} <br/>
                {!v.recordField.RecordType.Name}

</aura:component>