This document describes the PX1112 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1112 | Graphs and graph extensions with generic type parameters must be abstract. | Error | Available |
The PX1112 diagnostic detects and reports non-abstract graphs and graph extensions with generic type parameters.
In Acumatica Framework, graphs and graph extensions with generic type parameters must be declared as abstract. This requirement ensures proper inheritance and instantiation patterns within the Acumatica Framework.
Generic graphs and graph extensions serve as base classes that define common functionality to be shared across multiple derived implementations.
Since they contain unresolved type parameters, they cannot be directly instantiated by the framework. The abstract modifier makes this constraint explicit, keeps graph extensions relationships consistent, and prevents accidental instantiation attempts.
The PX1112 code fix automatically adds the abstract modifier to the graph or graph extension declaration.
If the class has the sealed modifier, the diagnostic automatically removes it (because abstract and sealed modifiers are mutually exclusive).
// Generic graph without abstract modifier - reports PX1112
public class GenericOrderGraph<TOrderDac> : PXGraph<GenericOrderGraph<TOrderDac>>
where TOrderDac : PXBqlTable, IBqlTable, new()
{
public PXSelect<TOrderDac> Orders = null!;
// Business logic
}public abstract class GenericOrderGraph<TOrderDac> : PXGraph<GenericOrderGraph<TOrderDac>>
where TOrderDac : PXBqlTable, IBqlTable, new()
{
public PXSelect<TOrderDac> Orders = null!;
// Business logic
}