This document describes the PX1028 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1028 | Constructors in DACs and DAC extensions are prohibited. | Error | Available |
The PX1028 diagnostic reports constructors defined in DACs and DAC extensions.
Constructors in DACs and DAC extensions are prohibited for the following reasons:
- DACs and DAC extensions are the classes that are used to read and write data. Therefore, for appropriate program architecture and design, DACs and DAC extensions cannot contain any business logic.
- Acumatica Framework creates DAC and DAC extension instances by using the default constructor without parameters.
The code fix for the PX1028 diagnostic removes the selected constructor from the DAC or DAC extension.
public class POLine : PXBqlTable, IBqlTable
{
public POLine() : base() // The PX1028 error is displayed for this line.
{
}
}public class POLine : PXBqlTable, IBqlTable
{
}