This document describes the PX1084 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1084 | PXGraph instances cannot be initialized within data view delegates. |
Error | Unavailable |
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.
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();
}
}