I have below code
if (gridObj.INVOICEORDERNUMBER) {
if (!cancelledStatus.length && !withDrawn.length) {
this.gridCmp.editValidation = true;
this.errorMessage = ErrorMessage.OpenOrderMsg;
} else {
this.relatedLicenses = false;
this.hasDRLPLicense = false;
this.deletePopupMsg = ErrorMessage.DeletePopupMsg;
this.showDeletePopup = true;
}
} else if (this.hasDRLPLicense) {
this.gridCmp.editValidation = true;
this.errorMessage2 = ErrorMessage.DRLPLicenseDeleteMsg;
} else {
this.relatedLicenses = false;
this.hasDRLPLicense = false;
this.deletePopupMsg = ErrorMessage.DeletePopupMsg;
this.showDeletePopup = true;
}
Here I need to check whether both if conditions satisfy or not. With the current approach, I can only check anyone if condition, as it is an if-else, if statement.
What I need to achieve here is
- If first
ifcondition is satisfied ->show errorMessage - If second
ifcondition (else if) satisfied ->show errorMessage2 - If both satisfied ->
show both errorMessage and errorMessage2 - If none satisfied ->
execute else
This might be a stupid question, but my brain is not working any more today. Please help. Thanks