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);
    }
}
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();
    }
}
| improve this answer | |
  • 1
    feeling like an idiot now , but thank you so much for your time and efforts. – gs650x Oct 31 '19 at 15:04

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.