By using PXUIFieldAttribute.SetEnabled we can access to the fields and modify their properties. I was wondering how.we can access to the standard buttons like as ok, cancel … on the smart panels and modify their properties?
Answer
how to access and enable/disable standard buttons on smart panels
Best answer by aaghaei
Thanks
yes, with a little bit of help I figured this out. Here is what I did.
protected virtual void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = e.Row as APInvoice;
if (row != null)
{
bool Enabled = (row.Status == APStatuses.PendingApproval || row.Status == APStatuses.Rejected || row.Status == APStatuses.OnHold) ? true : false;
route.SetEnabled(Enabled);
}
if (RoutingPanelDialog.Current != null)
{
bool Enabled = false;
Enabled = (RoutingPanelDialog.Current.Status == EPStatuses.Routed) ? false : true;
PXUIFieldAttribute.SetEnabled<EPRoutingPanelDialog.step>(cache, null, Enabled);
Enabled = false;
if (RoutingPanelDialog.Current.Step != null)
{
if (RoutingPanelDialog.Current.Owner != null || RoutingPanelDialog.Current.Workgroup != null)
{
Enabled = true;
}
}
ChangeOk.SetEnabled(Enabled);
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.


