Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 1.84 KB

PX1080.md

File metadata and controls

47 lines (37 loc) · 1.84 KB

PX1080

This document describes the PX1080 diagnostic.

Summary

Code Short Description Type Code Fix
PX1080 Data view delegates should not start long-running operations. Error Unavailable

Diagnostic Description

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.

Example of Incorrect Code

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();
    }
}

Related Articles