Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.59 KB

PX1084.md

File metadata and controls

39 lines (31 loc) · 1.59 KB

PX1084

This document describes the PX1084 diagnostic.

Summary

Code Short Description Type Code Fix
PX1084 PXGraph instances cannot be initialized within data view delegates. Error Unavailable

Diagnostic Description

PXGraph instances cannot be initialized within data view delegates. The initialization of complicated graphs in data view delegates affects the performance of the application. Also, when you create a new graph, you miss the query results that have already been cached in an existing graph.

To prevent the error from occurring, you should remove the creation of a PXGraph instance 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);

        var orderMaint = PXGraph.CreateInstance<SOOrderEntry>(); //The PX1084 error is displayed for this line.
        return sel.Select();
    }
}