This document describes the PX1003 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1003 | Consider using a specific implementation of PXGraph . |
Warning (ISV Level 2: Production Quality) | Unavailable |
To instantiate a graph type from code, you cannot use the graph constructor new T()
. However, you can use new PXGraph()
if you select or change records in the system context or generic context and if no specific implementation of PXGraph
can be used.
If you use new PXGraph()
instead of the instantiation of an instance of specific graph type, a part of platform-specific logic is omitted, such as the following:
- Collection and initialization of graph extensions
- Dependency injection
- Loading and unloading of the graph state from the session
However, new PXGraph()
works faster than the instantiation of a specific graph type through the PXGraph.CreateInstance<T>()
method.
To fix the issue, you should consider replacing new PXGraph()
with the instantiation of an instance of a specific graph type through the PXGraph.CreateInstance<T>()
method.
var graph = new PXGraph(); // The PX1003 warning is displayed for this line.