This document describes the PX1001 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1001 | A PXGraph instance must be created with the PXGraph.CreateInstance() factory method. |
Error | Available |
The PXGraph.CreateInstance<T>() method must be used to instantiate graph types from code. You cannot use the graph constructor new T().
The code fix replaces new T() with PXGraph.CreateInstance<T>().
var graph = new SOOrderEntry(); // The PX1001 error is displayed for this line.var graph = PXGraph.CreateInstance<SOOrderEntry>();