Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

#Trailhead Challenges2,374 discussing

Hands-on challenges are the “secret sauce” of Trailhead. Before searching for solutions to superbadge challenges, review the Salesforce Certification Program Agreement and Policies.

Dear all 

i have checked the link as below but still not solve the problem

https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007erH1vSAE

 

error is below 

In the boatPicker controller, we can’t find the proper configuration of which additional fields to display.

 

it looks like the problem comes from controller so i only shared my code as below , anyone who has passed the challenge please kindly give me some advices  

 

by the way 

i created the new playground , but still unsolve it .

the lwc works good in home page

截屏2024-11-20 11.05.16.png

 

截屏2024-11-20 11.05.41.png

 

 thanks in advanced 

 

import { LightningElement, wire} from 'lwc';

import { getRecord, getFieldValue } from 'lightning/uiRecordApi';

import BOAT_PICTURE_FIELD from "@salesforce/schema/Boat__c.Picture__c";

import BOAT_NAME_FIELD from "@salesforce/schema/Boat__c.Name";

import BOAT_OWNER_FIELD from "@salesforce/schema/Boat__c.Contact__r.Name";

import BOAT_PRICE_FIELD from "@salesforce/schema/Boat__c.Price__c";

import BOAT_TYPE_FIELD from "@salesforce/schema/Boat__c.BoatType__r.Name";

const BOAT_FIELDS = [BOAT_PICTURE_FIELD, BOAT_NAME_FIELD,BOAT_OWNER_FIELD, BOAT_PRICE_FIELD, BOAT_TYPE_FIELD];

export default class boatPicker extends LightningElement {   

    boatId;

    get showBoat() {

        return this.boatId != null;

    }

    @wire(getRecord, { recordId: '$boatId', fields: BOAT_FIELDS  })

    boatDetail;

 

    displayInfo = {

        primaryField: 'Name',

        additionalFields: ['BoatType__r.Name'],

    };

    matchingInfo = {

        primaryField: { fieldPath: 'Name' },

        additionalFields: [{ fieldPath: 'BoatType__r.Name' }],

    };

    // BEGIN GETTERS FOR BOAT FIELDS

    get boatPicture() {

        return getFieldValue(this.boatDetail.data, BOAT_PICTURE_FIELD);

    }

    get boatName() {

        return getFieldValue(this.boatDetail.data, BOAT_NAME_FIELD);

    }

    get boatOwner() {

        return getFieldValue(this.boatDetail.data, BOAT_OWNER_FIELD);

    }

    get boatPrice() {

        return getFieldValue(this.boatDetail.data, BOAT_PRICE_FIELD);

    }

    get boatType() {

        return getFieldValue(this.boatDetail.data, BOAT_TYPE_FIELD);

    }

    // END GETTERS FOR BOAT FIELDS

    get backgroundStyle() {

        if (!this.showBoat) {

            return '';

        } else {

            return `background-image:url('${this.boatPicture}')`;

        }

    }

    handleChange(event) {

        this.boatId = event.detail.recordId;

        console.log("Selected Value: " + this.boatId);

        console.log("Selected: " + JSON.stringify(event.detail));

    }

}

 

#Trailhead Challenges

25 answers
  1. Nov 28, 2024, 5:40 PM

    HI @peng tang 

    I am a member of the Trailhead Help team. Apologies for the inconvenience caused.

     

    There was an issue with the JS1 Maintenance module, but it has now been resolved. Could you please try re-doing the module in a new playground?

     

    Thank you!

0/9000

I am in the 'Define Sharing Rules' module and cannot find the 'Review' object in my Playground. Is there a way to find the necessary attributes for this object so that I can create it manually or somehow get it added to the playground? 

 

#Trailhead Challenges

3 answers
  1. Jan 21, 3:40 PM

    Hi @Donna Salas I am a member of Trailhead Help, Can you please check with the above suggestions and let us know if the issue still exists or is resolved? If it is resolved, please post the solution or mark any one of them above which helped you to resolve your query as it "Best Answer" to close this thread. If not, kindly provide a few more details of the badge along with the error message. Thank You!  

     

    ++TrailheadHelpFollowUp

0/9000