You need to sign in to do that
Don't have an account?
Nagaraju Mogili 15
Could not find a component named MyContactList' on the Account record page.
while working on the Trailhead Tasks, I am getting the below error, please anyone advise me anyone on this.
Controller code :
public class MyContactListController{
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
}
===============================================================================
===============================================================================
component code -
<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>
</aura:component>
=================================================================================
===================================================================================
I am getting the below error.
Challenge Not yet complete... here's what's wrong:
Could not find a component named MyContactList' on the Account record page.
Controller code :
public class MyContactListController{
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
}
===============================================================================
===============================================================================
component code -
<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>
</aura:component>
=================================================================================
===================================================================================
I am getting the below error.
Challenge Not yet complete... here's what's wrong:
Could not find a component named MyContactList' on the Account record page.
You have created the component, but not added to Account-Page.
Steps as follows :
- In Salesforce, click the App Launcher icon and select Accounts tab and select any Account (ex: United Oil & Gas Corp.).
- Click the gear icon (*), then select Edit Page to open the Lightning App Builder.
- Drag the MyContactList custom component from the Lightning Components list to the page and place it in the right column.
- Click Save.
- Click Activate.
- Click Assign as Org Default, then click Save.
- Click Back to return to the record page.
#HappyTrailheadRayan
The below code I have copied and paste 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}">
<lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" hideCheckboxColumn="true"/>
</lightning:card>
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
</aura:component>
==============================================================================================
In the Trailhead, I am getting the below error.
The component does not contain the correct lightning:card markup.
can you please help me, what I have done wrong here.
However, am getting the same inital error as u get "Could not find a component named MyContactList' on the Account record page."
Please someone suggest what we need to cross check
I faced the same problem and could not find the solution.
What I did, that works for me, was restart the trail in a new org.
Even I'm also faced the same problem and can't find the solution, so created a new playgound and recreated the controller and component and working fine now.
Thanks
The instructions say: "Click the Setup icon ... to access Setup in Lightning Experience and choose Edit Page to launch App Builder, the Drag your component from the Custom components list and drop it at the top of the right-hand column, above the Activity component."
When I open the United Oil & Gas Corp. record, then select "Edit Page" then *** There are no custom components listed *** I do not see a component called 'MyContactList' nor 'MyContactListController' ... (see screen shot below).
** For some reason, my developer Sales environment doesn't see my just-build custom components...
Does anyone have a possible fix for this?
Thanks
Jarrell
jarrell.dunson@uky.edu
Here is what I've tried:
1. I've tried logging out, closing the Chrome browser, logging in...
2. I've tried to change the Apex names, per this link: https://salesforce.stackexchange.com/questions/92847/cant-set-lightning-component-controller: From MyContactListController to MyContactListControllers {and have changed the name back again}
3. I've tried to edit the MyContactListController object, per Simon Johnstone 6, on this page:
https://developer.salesforce.com/forums/?id=9060G000000I8W9QAK
public class MyContactListController {
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
List<Contact> cs = [SELECT Id,
FirstName,
LastName,
Email,
Phone
FROM Contact
WHERE AccountId = :recordId
];
return cs;
}
}
To do this: Clicking the activation button > Set as org default.
This has resolved the problem for me.