Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.41 KB

PX1082.md

File metadata and controls

39 lines (31 loc) · 1.41 KB

PX1082

This document describes the PX1082 diagnostic.

Summary

Code Short Description Type Code Fix
PX1082 Actions cannot be executed within data view delegates. Error Unavailable

Diagnostic Description

Actions cannot be executed within data view delegates. Data view delegates are designed to prepare a data set to be displayed in the UI or used in the code.

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 the code that executes an action from the data view delegate and rework the related business logic.

Example of Incorrect Code

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