This document describes the PX1082 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1082 | Actions cannot be executed within data view delegates. | Error | Unavailable |
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()
andPXProcessingBase.SetProcessDelegate()
- The
PXGraph.Persist()
method FieldUpdated
andRowUpdated
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.
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.
...
}
}