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
ChinnoduChinnodu 

Lightning Component Framework Specialist super badge step Two

Hi All,
I am stuck at Step 2. Getting following error :-

Please help me on this .

User-added image
Please see the below code :
 
BoarsearchFormController.js


({
	doInit : function(component, event, helper){
        var action = component.get("c.getBoatTypes");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.boatTypes", response.getReturnValue());
            }
            else {
                console.log("Failed with state: " + state);
            }
        });
        // Send action off to be executed
        $A.enqueueAction(action);
    },
    
   
    
    
    createRecord : function (component, event, helper) {
        var BoatTypeid = component.find("boatType").get("v.value");
        var createRecordEvent = $A.get("e.force:createRecord");
        if(!$A.util.isEmpty(BoatTypeid)){
            createRecordEvent.setParams({
                'entityApiName': 'Boat__c',
                'defaultFieldValues':{
                    'BoatType__c' : BoatTypeid
                }
            });
            createRecordEvent.fire();
        }else{
            createRecordEvent.setParams({
                'entityApiName': 'Boat__c'
            });
            createRecordEvent.fire();
        }
    } ,
    eventhandler : function (component, event, helper) {
        
    } */
})



BoatSearchForm.cmp:


<aura:component controller="BoatTypes" implements="force:appHostable,flexipage:availableForAllPageTypes"  access="global" >
    <lightning:card title="Find a Boat"  class="slds-align_absolute-Left" >
    </lightning:card>
   
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>    
    <aura:handler name="init" value="{!this}" action="{!c.newBoat}"/>
    <aura:attribute name="boatTypes" type="BoatType__c[]"/>
     <aura:attribute name="selectedType" type="String" default="foo"/>
    <aura:attribute name="showNewButton" type="boolean" default="true"/>
    
    <!--<aura:registerEvent name="launchNewBoatForm" type="c:launchNewBoatForm"/>
    <aura:handler name="launchNewBoatForm" event="c:launchNewBoatForm" action="{!c.eventhandler}"/>-->


    <lightning:layout horizontalAlign="center" verticalAlign="end">

       <lightning:layoutItem class="slds-grid_vertical-align-center" padding="around-small" > 

           <lightning:select aura:id="boatSelect"  label=""  name="selectItem">
             <aura:iteration items="{!v.boatTypes}" var="boatType">
                 <option value="" text="All Types"/>
                 <option value="{!boatType.id}" text="{!boatType.Name}"></option>
             </aura:iteration>
         </lightning:select>
       </lightning:layoutItem>

       <lightning:layoutItem class="slds-grid_vertical-align-center" padding="around-small"> 
         <lightning:button label="Search" variant="brand"  />
         <aura:if isTrue="{!v.showNewButton}">
            <lightning:button variant="neutral" label="New" onclick="{!c.newBoat}"/>
        </aura:if>
       </lightning:layoutItem>

    </lightning:layout>

</aura:component>

 
Raj VakatiRaj Vakati
Refer this link for code 

https://salesforceallinone.blogspot.com/2018/03/lightning-component-framework_87.html