This document describes the PX1058 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1058 | A PXGraph instance cannot save changes to the database during the PXGraph initialization. |
Error | Unavailable |
A PXGraph
instance cannot save changes to the database during the PXGraph
initialization (that is, in PXGraph
constructors, in the Initialize
method overridden in PXGraphExtension
, or handlers subscribed at run time through the static InstanceCreated
member of PXGraph
).
To fix the issue, you should remove from the PXGraph
initialization the code that saves the changes to the database and rework the related business logic.
public class SWKMapadocSOOrderProcess : PXGraph<SWKMapadocSOOrderProcess>
{
public SWKMapadocSOOrderProcess()
{
int icount = orders.Select().Count;
if (icount > 1)
{
SWKMapadocSOOrder dummy = PXSelect<SWKMapadocSOOrder,
Where<SWKMapadocSOOrder.cloudPk,
Equal<Required<SWKMapadocSOOrder.cloudPk>>>>
.Select(this, 0);
orders.Delete(dummy);
Actions.PressSave(); // The PX1058 error is displayed for this line.
}
}
}