You need to sign in to do that
Don't have an account?

Lightning Component Framework Specialist super badge step Two
Hi All,
I am stuck at Step 2. Getting following error :-
Please help me on this .

Please see the below code :
I am stuck at Step 2. Getting following error :-
Please help me on this .
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>
https://salesforceallinone.blogspot.com/2018/03/lightning-component-framework_87.html