On a Simple dialog form when the dialog checkbox “Ignore minimum qty” is false then disable the dialog checkbox “dialogShowUsrDialog” else enable it and set the value to true.
To do this we need to call the registerOverrideMethod when declaring dialogfields and write a new modified method.
public void openQtyParmsDialog()
{
dialog = new Dialog(“Check Quantities”);
dialogIgnoreMinQty = dialog.addField(extendedTypeStr(NoYesId), “Ignore minimum Qty”);
dialogShowUsrDialog = dialog.addField(extendedTypeStr(NoYesId), “Pop-up message”);
//Override modified method for dialogIgnoreMinQty
dialogIgnoreMinQty.registerOverrideMethod(methodStr(FormStringControl, modified), methodStr(ERAStageCheckPurchTable, dialogIgnoreMinQty_modified), this);
dialog.run();
if (dialog.closedOk())
{
this.parmCheckMinQty(!dialogIgnoreMinQty.value());
this.parmShowUsrDialog(dialogShowUsrDialog.value());
}
}
private boolean dialogIgnoreMinQty_modified(FormCheckBoxControl _dialogIgnoreMinQty)
{
//If IgnoreQty = true then dialogShowUsrDialog value is false and disable
if (_dialogIgnoreMinQty.value() == true)
{
dialogShowUsrDialog.value(false);
dialogShowUsrDialog.enabled(false);
}
else
{
//If IgnoreQty = false then dialogShowUsrDialog value is true and enabled
dialogShowUsrDialog.value(true);
dialogShowUsrDialog.enabled(true);
}
return true;
}