1

I have below JS code in the console log I can see the expected value for configFlowName but in setGoToMapSupplyQuantity the value of configFlowName is undefined, I completely understand this behavior but I don't understand how to wait till the configflow get its value and then use it in the setGoToMapSupplyQuantity function, please suggest any work around

@track configFlowName;
setGoToMapSupplyQuantity() {
    this.goToMapSupplyQuantity = '/apex/Apttus_Config2__pricing?id=' + this.productConfigId + '&configRequestId=' + this.configRequestId + '&Flow=' + this.configFlowName;
}


@wire(proposalDetails, { productConfigId: '$productConfigId' })
proposalDetail({ data }) {
    if (data) {
        this.proposalData   = data;
        this.proposalId     = '/'+ data.proposalID;
        this.configFlowName = data.flowName;
        console.log(this.configFlowName);
    }
}

1 Answer 1

2

You can make a call to the setGoToMapSupplyQuantity function inside your if statement, which will set the goToMapSupplyQuantity property.

@wire(proposalDetails, { productConfigId: '$productConfigId' })
proposalDetail({ data }) {
    if (data) {
        this.proposalData   = data;
        this.proposalId     = '/'+ data.proposalID;
        this.configFlowName = data.flowName;
        this.setGoToMapSupplyQuantity();
    }
}
1
  • 1
    feeling like an idiot now , but thank you so much for your time and efforts.
    – gs650x
    Commented Oct 31, 2019 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .