You need to sign in to do that
Don't have an account?
Albert van Gink
Trailhead Quick start: Create a Lightning Component
Hi,
Trailhead: https://trailhead.salesforce.com/projects/quickstart-lightning-components/steps/quickstart-lightning-components3
Problem saving MyContactList.cmp.
Field_Integrity_Exception: Failed to save MyContactList.cmp: Invalid definition for null:MyContactListComponent: null: Source
MCLC.apxc:
public class MyContactListController {
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
}
MCL.cmp:
<aura:component controller="MyContactListComponent" 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>
Anyone any idea or suggestion to help?
Thank you, regards, albert
Trailhead: https://trailhead.salesforce.com/projects/quickstart-lightning-components/steps/quickstart-lightning-components3
Problem saving MyContactList.cmp.
Field_Integrity_Exception: Failed to save MyContactList.cmp: Invalid definition for null:MyContactListComponent: null: Source
MCLC.apxc:
public class MyContactListController {
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
}
MCL.cmp:
<aura:component controller="MyContactListComponent" 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>
Anyone any idea or suggestion to help?
Thank you, regards, albert
use below component code :
use controller="MyContactListController" not
controller="MyContactListComponent"i hope it helps you.Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
sfdcmonkey.com
All Answers
use below component code :
use controller="MyContactListController" not
controller="MyContactListComponent"i hope it helps you.Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
sfdcmonkey.com
4. Add a reference to the Apex controller, controller="MyContactListComponent", on the aura:component tag.
Regards, albert
FIELD_INTEGRITY_EXCEPTION
Failed to save MyContactList.cmp: Invalid definition for null:MyContactListController: null: Source
Any ideas on how to get past this? Thanks
We redid the first step in the exercise:
When you copy the class information, it saves regardless of spaces after the red letters. I must have originally copied the space after when I did this step. this was why my second step couldnt accept the class name for the exercise to work.
I redid the step, made sure that my new class name had no gaps before or after the red text. It save and I completed the text.
When I then verified the next step, it worked.
I am trying to write trigger to change the oppotunity's city whenever related account's city updated. but problam is that it producing the error.
please check it.
https://trailhead.salesforce.com/en/content/learn/projects/quickstart-lightning-components/quickstart-lightning-components2