Hi, I’m working with a PXSmartPanel containing two grids. And i have condition that whenever Qty is less or equal to zero or serial/lot nbr isnt filled in when needed, then the dialog shouldnt close, ok button become disabled so user can fill the necessary fields and only then then button can be enabled. The button only becomes disabled when some of the fields with CommitChanges=true are updated. And if i hit the button at first when its still enabled, an error/exception occurs:

Here’s the button:
<px:PXPanel ID="PanelPromptSummaryBtn" runat="server" SkinID="Buttons">
<px:PXButton ID="PromptSummaryOk" runat="server" Text="OK" CommandSourceID="ds"
DialogResult="OK" CommandName="promptSummaryOk">
</px:PXButton>
protected virtual void _(Events.RowSelected<TPrimary> e)
{
TPrimary row = e.Row;
bool validationResult = PromptValidateData();
PromptSummaryOk.SetEnabled(validationResult);
}
and also
protected virtual void _(Events.RowSelected<EPTimeTrackerPromptSummary> e)
{
EPTimeTrackerPromptSummary row = e.Row;
EPTTSetup setup = Base.Caches<EPTTSetup>().Current as EPTTSetup ?? PXSelect<EPTTSetup>.Select(Base);
if (row == null)
return;
bool validationResult = PromptValidateData();
PromptSummaryOk.SetEnabled(validationResult);
}
I verified that validationResult returns true initially when the SmartPanel opens. I've also tried feldVerifying and placing validation directly inside the Action method and setting Action button Enabled property to false, but neither resolved the issue.
Thank you