This document describes the PX1080 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1080 | Data view delegates should not start long-running operations. | Error | Unavailable |
Data view delegates should not start long-running operations. A data view delegate is designed to prepare a data set to display it in the UI. The result that returns the data view delegate is returned before the end of the long-running operation.
To prevent the error from occurring, you should remove the code that starts a long-running operation from the data view delegate and rework the related business logic.
public class ShipmentProcess : PXGraph<ShipmentProcess>
{
[PXFilterable]
public PXFilteredProcessingJoin<SOShipment, ShipFilter,
LeftJoin<Customer,
On<SOShipment.customerID, Equal<Customer.bAccountID>>>,
Where<CustomerExtension.sCust, Equal<True>,
And<CustomerExtension.sReq, Equal<True>>>>
ShipmentList;
protected virtual IEnumerable shipmentList()
{
var sel = new PXSelectJoin<SOShipment,
InnerJoin<BAccount,
On<SOShipment.customerID,
Equal<BAccount.bAccountID>>>>(this);
PXLongOperation.StartOperation(this, delegate () //The PX1080 error is displayed for this line.
{
//update records
});
return sel.Select();
}
}