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
Spencer BerkSpencer Berk 

RecordViewForm Component for Community

I am trying to create a recordViewForm component in my Salesforce Community that displays specific fields (read only) from the loggedin user's Account record. I am not a developer so any help would be greatly appreciated.
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
     
    <lightning:recordViewForm recordId="{!v.recordId}" objectApiName="Account">
        <div class="slds-grid">
            <div class="slds-col slds-size_1-of-2">
            	<lightning:outputField fields="Agreement_Date__c"/>
            </div>
            <div class="slds-col slds-size_1-of-2">
            	<lightning:outputField fields="Renewal_Date__c"/>
            </div>
        </div>
    </lightning:recordViewForm>
</aura:component>

This is the error I receive when clicking on the community page with this component, in the Community Building:
User-added image
 
Best Answer chosen by Spencer Berk
srini chintalaputisrini chintalaputi
Hi Spencer berk,

 <lightning:outputField fields="Agreement_Date__c"/>

Please change the Fields to Fieldname
<lightning:outputField fieldName="Agreement_Date__c"/>

Thanks,
Srinivas.