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
Mounika@9999Mounika@9999 

Fetch the data from object without using apex in aura?

Hi All,why it is not displying pls tell me and give me updated code if u find any mistake, Thanks!
 <lightning:recordViewForm objectApiName="ccrz__E_PageLabel__c" recordId="a2w7h000001DjrXAAS">
        <div class="slds-box slds-theme_default">
            <lightning:outputField fieldName="Name"/>
            <lightning:outputField fieldName="CartLineNote"/>
        </div>
 </lightning:recordViewForm>
I checked all the things are correct! field name, record id,object name and accessibility.
VinayVinay (Salesforce Developers) 
Hi Mounika,

Try using below sample code.
<aura:component>
    <lightning:recordViewForm recordId="001XXXXXXXXXXXXXXX" 
                              objectApiName="Account">
    <div class="slds-grid">
        <div class="slds-col slds-size_2-of-3">
            <lightning:outputField fieldName="Name" />
            <lightning:outputField fieldName="Phone" />
        </div>
        <div class="slds-col slds-size_1-of-3">
            <lightning:outputField fieldName="Industry" />
            <lightning:outputField fieldName="AnnualRevenue" />
        </div>
    </div>
</lightning:recordViewForm>
</aura:component>

Please mark as Best Answer if above information was helpful.

Thanks,