0

I have requirement to display a data table based on the row actions of another data table through pop-up.

I have done the pop-up through row actions But I am unable to pass the id of the row to the @wire object to get the query and display in the data table.

Please find the JS below.

@track currentRecord1 = [] ;

@wire(showGradingSamples, {recordId : '$currentRecord1'})
sampleSeededAcres;
openGradingSample(row)
{
    let currentRecord1 = [] ;
    currentRecord1.push(row.Id);

    showGradingSamples({lstprodId1s: currentRecord1});

    this.isOpenGradingSample = true;

    return currentRecord1;
}

How can I pass the id?

0

Just assign a value to tracked variable.

this.currentRecord1 = [row.Id];

This will cause the wire method to dispatch. No need for the local variable or anything else you've done here. You do not call wire methods as you would an imperative Apex call.

If you want all the values to be selected cumulatively, you can also:

this.currentRecord1 = [...this.currentRecord1, row.Id];
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.