Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 2.34 KB

File metadata and controls

49 lines (38 loc) · 2.34 KB

PX1081

This document describes the PX1081 diagnostic.

Summary

Code Short Description Type Code Fix
PX1081 Actions cannot be executed during the PXGraph initialization. Error Unavailable

Diagnostic Description

Actions cannot be executed during the PXGraph initialization. During the PXGraph initialization, PXGraph is not yet ready for execution of the actions. 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

During the PXGraph initialization, you can configure basic UI presentation logic and can make sure that all necessary configuration data for the screen is available. Any other business logic should not be executed during the PXGraph initialization.

Actions can be executed in the following places:

  • Another action delegate
  • Processing delegates: PXLongOperation.StartOperation() and PXProcessingBase.SetProcessDelegate()
  • The PXGraph.Persist() method
  • FieldUpdated and RowUpdated event handlers
  • Contract-based API endpoint adapters
  • The PXGraph.ExecuteUpdate method

To prevent the error from occurring, you should remove from the PXGraph initialization the code that executes an action and rework the related business logic.

Example of Incorrect Code

public class SOOrderEntry : PXGraph<SOOrderEntry, SOOrder>
{
	public PXAction<SOOrder> Release;
	...
	public SOOrderEntry()
	{
		Release.Press(); // The PX1081 error is displayed for this line.
		Cancel.Press(new PXAdapter(...)); // Another PX1081 error is displayed for this line.
	}
}

Related Articles