You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
Hello in my LWC I'm showing all records in page and I want to show only those records which are matching with record id from url.
I tried with @api recordId but that didn't bring result I'm doubtful whether my implementation was correct.
I also tried with event.target.value but that showing error.
store result in array if id from url is matching with id of result
Hello in my LWC I'm showing all records in page and I want to show only those records which are matching with record id from url.
I tried with @api recordId but that didn't bring result I'm doubtful whether my implementation was correct.
I also tried with event.target.value but that showing error.
import getActiveSessions from '@salesforce/apex/DCController.TBT_getActiveSessions'; _getActiveSessions(){ getActiveSessions().then(response=>{ this.dataToDisplay = response // for(let i=0;i< this.dataToDisplay.length; i++){ // if(this.dataToDisplay[i].id == recordId){ // I tried this way but not getting through it // this.clientData[i] = this.dataToDisplay[i]; // } // } console.log(response) }).catch(error=>{ console.log(error) }) ; console.log('client data '+clientData); }
//event query running in apex class and that result is coming to LWC by getActiveSessions method Select Id, Subject, WhatId, WhoId, Who.Name, EndDate, EndDateTime,Start_Date_Time__c , OwnerId, ActivityDate, ActivityDateTime, Facilities__c,Facilities__r.Name, Services__c, Appointment_Status__c, Description, DC_Session_Start_Time__c, DC_Session_End_Time__c, DC_Session_Run_Time__c, DC_Session_Status__c, DC_Session_Last_Start_Time__c, End_Time__c, IsRecurrence, DOSSession__c, What.Name From Event'can anyone please look into it and guide.
To show only the record that matches with the record ID from the URL in your LWC, you can use the @wire decorator and getRecord method from the lightning/uiRecordApi module.
Example:
Make sure that the recordId attribute is being passed to your LWC component from the URL correctly. You can check this by adding the following code to your LWC's JS file:
If this information helps, please mark the answer as best. Thank you