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
Bosede Omolayo 16Bosede Omolayo 16 

Create Lightening Componenet

Hi,

Does anyone know why this code for Trailhead:Create a lightning Component is generating the error below?

<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />

<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />

<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
    <!-- Contact list goes here -->
</lightning:card>

Error Message: There was an unhandled exception. Please reference ID: DADNTVQQ. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2

Thank you
Best Answer chosen by Bosede Omolayo 16
SandhyaSandhya (Salesforce Developers) 
Hi,

Make sure that you have complete code in the component.
 
<aura:component controller="MyContactListController" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />

<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />

<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
    <!-- Contact list goes here -->
</lightning:card>

If this does not work I would suggest you try in new trailhead playground.

If this helps you, please mark it as solved so that it will be available for others.

Best Regards,
Sandhya

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

Make sure that you have complete code in the component.
 
<aura:component controller="MyContactListController" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />

<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />

<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
    <!-- Contact list goes here -->
</lightning:card>

If this does not work I would suggest you try in new trailhead playground.

If this helps you, please mark it as solved so that it will be available for others.

Best Regards,
Sandhya
This was selected as the best answer
Bosede Omolayo 16Bosede Omolayo 16
Trying in new trailhead playground worked. Thank you.