Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 2.36 KB

File metadata and controls

52 lines (37 loc) · 2.36 KB

PX1112

This document describes the PX1112 diagnostic.

Summary

Code Short Description Type Code Fix
PX1112 Graphs and graph extensions with generic type parameters must be abstract. Error Available

Diagnostic Description

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.

Code Fix Behavior

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).

Example of Incorrect Code

// 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
}

Example of Correct Code after Code Fix

public abstract class GenericOrderGraph<TOrderDac> : PXGraph<GenericOrderGraph<TOrderDac>>
where TOrderDac : PXBqlTable, IBqlTable, new()
{
	public PXSelect<TOrderDac> Orders = null!;
		
	// Business logic
}

Related Articles