Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.44 KB

PX1003.md

File metadata and controls

27 lines (18 loc) · 1.44 KB

PX1003

This document describes the PX1003 diagnostic.

Summary

Code Short Description Type Code Fix
PX1003 Consider using a specific implementation of PXGraph. Warning (ISV Level 2: Production Quality) Unavailable

Diagnostic Description

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.

Example of Code that Results in the Warning

var graph = new PXGraph(); // The PX1003 warning is displayed for this line.