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
Frederick H LaneFrederick H Lane 

Lightning Component Framework Specialist Step 7 Error Message

I have the following error message;

"We couldn't find an attribute boat of type Boat__c on the AddBoatReview component."

My code is;
BoatReviews.cmp
view sourceprint?
01BoatReviews.cmp
02 
03<aura:componentimplements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"access="global"
04                controller="BoatReviews">
05     
06     <aura:attribute name="boat" type="Boat__c" access="public"/>
07    <aura:handler name="change" value="{!v.boat}" action="{!c.refresh}"/>
08    <aura:attribute name="boatReviews" type="BoatReview__c[]" access="private"/>
09    <!-- set up the aura:method for refresh -->
10    <aura:method name="refresh" action="{!c.doInit}" access="public"
11                 description="BoatDetailsController.js invokes refresh whenever boat is updated">
12    </aura:method>
13      
14    <ui:scrollerWrapper class="scrollerSize">
15        <!--Scrollable content here -->
16        <aura:if isTrue="{!v.boatReviews.length==0}">
17            <lightning:layoutItem class="slds-align_absolute-center" flexibility="auto"padding="around-small">  
18                <ui:outputText value="No Reviews Available" />
19            </lightning:layoutItem>
20        </aura:if>
21        <div class="slds-feed">
22            <ul class="slds-feed__list">
23                <aura:iteration items="{!v.boatReviews}" var="boatReview">
24                    <li class="slds-feed__item">
25                        <div class="slds-media__body">
26                       <div class="slds-grid slds-has-flexi-truncate">
27                            <a href="javascript:void(0)" onclick="{!c.onUserInfoClick}"
28          data-userid="{!boatReview.CreatedBy.Id}">
29          {!boatReview.CreatedBy.Name}
30      </a>
31                        &nbsp; &mdash; &nbsp; {!boatReview.CreatedBy.CompanyName}
32   </div>
33                         <p><lightning:formattedDateTime value="{!boatReview.CreatedDate}"
34                                   year="numeric" month="short" day="numeric" 
35                                   hour="2-digit" minute="2-digit" hour12="true"/></p>
36                        </div>
37                    </li>
38                </aura:iteration>
39            </ul>
40        </div>
41    </ui:scrollerWrapper>
42     
43     
44</aura:component>
 
01BoatReviewsController.js
02({
03    refresh : function(component,event,helper){
04        console.log("refresh called")
05        this.doInit;
06    },
07    doInit : function(component,event,helper){
08        console.log("BRCjs: doInit");
09        helper.onInit(component, event);
10    },
11    onUserInfoClick : function(component,event,helper){
12        var userId = event.currentTarget.getAttribute("data-userid");
13        var navEvt = $A.get("e.force:navigateToSObject");
14        navEvt.setParams({
15            "recordId" : userId,
16        });
17        navEvt.fire()
18 
19    },
20})
 
01BoatReviewsHelper.js
02({
03    onInit : function(component, event){
04                var boat = component.get("v.boat");
05                console.log("BRHjs:onInit started: boatId is " + boat.Id);
06                var action = component.get("c.getAll");
07                action.setParams({"boatId" : boat.Id});
08                console.log("boatId: " + boat.Id);
09 
10                //add the callback behavior for when the response is received
11                action.setCallback(this,function(response){
12                    var state = response.getState();
13                    if (state === "SUCCESS"){
14                        component.set("v.boatReviews", response.getReturnValue());
15                        console.log("APEX success");
16                        }
17                        else {
18                        console.log("Failed with state: " + state);
19                        }
20                });
21                //send action off to be executed in APEX
22                $A.enqueueAction(action);
23    },
24})
 
1BoatSelected.evt
2<aura:event type="APPLICATION" description="BoatSelected fired from BoatTileController's onBoatClick handler">
3    <aura:attribute name="boat" type="Boat__c"/>
4</aura:event>
 
Best Answer chosen by Frederick H Lane
cvntst scrtycvntst scrty
Dear Frederick Lane:

Caveon works with the Salesforce Credential and Certification Program (the “Program”) to ensure that Trailhead users understand and abide by rules that apply to the pursuit and achievement of Superbadges. Efforts in this regard are intended to ensure that the Program is fair for all members, and that the achievement of a Superbadge continues to reliably demonstrate the Trailhead member’s knowledge and skills.

An important rule that Trailhead users must follow in the pursuit and achievement of Superbadges is the requirement to refrain from sharing or disclosing solutions that you or others have developed to achieve a Superbadge. Remember that keeping answers and solutions confidential was a big part of the Program's Terms and Conditions, which you agreed to when launching your Superbadge(s).

We are writing to you because it appears you posted one or more Superbadge solutions on https://developer.salesforce.com/forums/?id=9060G0000005kapQAA. We are asking you to please remove the Superbadge solution you posted on https://developer.salesforce.com/forums/?id=9060G0000005kapQAA and in any other location that you might have posted the content, so that other Trailhead members may develop their own solutions.

Keep in mind that your participation in the Program requires you to abide by the rules. If you fail to remove the confidential Superbadge solution, or disclose or distribute additional confidential content in violation of the rules, Salesforce can remove you from the Trailhead community and prohibit you from participating in the Program.

We sincerely appreciate your assistance in maintaining the fairness and integrity of the Trailhead community and the Program. If you believe your post doesn't share superbadge content, let us know so we can update our process.

Sincerely,
Christie Zervos
Caveon
Cc: [Salesforce]
 

All Answers

Raj VakatiRaj Vakati
Refer this link 

https://github.com/grivero/Lightning-Component-Framework-Specialist
Frederick H LaneFrederick H Lane
I don't understand? When we share information on the forum, every step is explained step-by-step via .cmp, Helper etc. The link you send doesn't help. I would prefer just an answer on what I'm doing wrong so I can learn or code listed as we all do in SFDC community?
cvntst scrtycvntst scrty
Dear Frederick Lane:

Caveon works with the Salesforce Credential and Certification Program (the “Program”) to ensure that Trailhead users understand and abide by rules that apply to the pursuit and achievement of Superbadges. Efforts in this regard are intended to ensure that the Program is fair for all members, and that the achievement of a Superbadge continues to reliably demonstrate the Trailhead member’s knowledge and skills.

An important rule that Trailhead users must follow in the pursuit and achievement of Superbadges is the requirement to refrain from sharing or disclosing solutions that you or others have developed to achieve a Superbadge. Remember that keeping answers and solutions confidential was a big part of the Program's Terms and Conditions, which you agreed to when launching your Superbadge(s).

We are writing to you because it appears you posted one or more Superbadge solutions on https://developer.salesforce.com/forums/?id=9060G0000005kapQAA. We are asking you to please remove the Superbadge solution you posted on https://developer.salesforce.com/forums/?id=9060G0000005kapQAA and in any other location that you might have posted the content, so that other Trailhead members may develop their own solutions.

Keep in mind that your participation in the Program requires you to abide by the rules. If you fail to remove the confidential Superbadge solution, or disclose or distribute additional confidential content in violation of the rules, Salesforce can remove you from the Trailhead community and prohibit you from participating in the Program.

We sincerely appreciate your assistance in maintaining the fairness and integrity of the Trailhead community and the Program. If you believe your post doesn't share superbadge content, let us know so we can update our process.

Sincerely,
Christie Zervos
Caveon
Cc: [Salesforce]
 
This was selected as the best answer