Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.83 KB

File metadata and controls

43 lines (35 loc) · 1.83 KB

PX1058

This document describes the PX1058 diagnostic.

Summary

Code Short Description Type Code Fix
PX1058 A PXGraph instance cannot save changes to the database during the PXGraph initialization. Error Unavailable

Diagnostic Description

A PXGraph instance cannot save changes to the database during the PXGraph initialization. The following code elements are considered to be a part of the graph initialization:

  • The PXGraph and PXGraphExtension constructors
  • The Initialize method overridden in PXGraphExtension
  • The Initialize method of PXGraph that implements the PX.Data.DependencyInjection.IGraphWithInitialization interface
  • The Configure method overridden in PXGraph and PXGraphExtension

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.

Example of Incorrect Code

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.
		}
	}
}

Related Articles