Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.82 KB

PX1081.md

File metadata and controls

39 lines (30 loc) · 1.82 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 (that is, in PXGraph constructors, in the Initialize method overridden in PXGraphExtension, or in handlers subscribed at run time through the static InstanceCreated member of PXGraph). During the PXGraph initialization, PXGraph is not yet ready for execution of the actions.

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