+ Start a Discussion
victor verma 1victor verma 1 

lwc superbadge step 9 error

Challenge Not yet complete... here's what's wrong:
We can't find the correct boatTypeId variable setting in the searchBoats method in the component boatSearch JavaScript file. Make sure the variable and method were created according to the requirements.
 
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class BoatSearch extends NavigationMixin(LightningElement) {
    isLoading = false;
    boatTypeId;

    // Handles loading event
    handleLoading() {
        this.isLoading = true;
    }

    // Handles done loading event
    handleDoneLoading() {
        this.isLoading = false;
    }

    // Handles search boat event
    // This custom event comes from the form
    searchBoats(event) {

        this.boatTypeId = event.detail.boatTypeId;
        this.template.querySelector('c-boat-search-results').searchBoats(this.boatTypeId);
    }
}

createNewBoat() {
    this[NavigationMixin.Navigate]({
        type: 'standard__objectPage',
        attributes: {
            objectApiName: 'Boat__c',
            actionName: 'new',
        },
    });
}
}

 
VinayVinay (Salesforce Developers) 
Hi,

We have a separate Trailhead team who can help you with these issues. So, can you please use the below link to reach out to them so that one of the agent will get in touch with you.

Support:https://trailhead.salesforce.com/help

Thank you!

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks,
Vinay Kumar
Francis CrumpFrancis Crump
This worked for me:

boatSearch.js

import { LightningElement , track ,api} from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
// imports
export default class BoatSearch extends NavigationMixin(LightningElement) {
    @track isLoading = true;
    
    handleLoading()
    {
        this.isLoading = true;
    } 
    handleDoneLoading()
    {
        this.isLoading = false;
    }
    createNewBoat() {
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Boat__c',
                actionName: 'new'
            }
        });
    }
    searchBoats(event)
    {
        this.boatTypeId = event.detail.boatTypeId;
        this.template.querySelector('c-boat-search-results').searchBoats(this.boatTypeId);
    }
}
victor verma 1victor verma 1
Thanks Francis, I already cleared it few days back. Right now struck in Challenge 13. Thanks for replying.