This document describes the PX1023 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1023 | The DAC property is marked with multiple field type attributes. | Error | Available |
The diagnostic verifies the following rules:
- The DAC property field must have only one field type attribute, such as
PXDBBool
orPXInt
. - The DAC property field cannot have multiple special attributes, such as
PXDBCalced
andPXDBScalar
. - If the DAC property has an attribute derived from the
PXAggregateAttribute
, this attribute cannot aggregate incompatible field type attributes (such asPXBool
and `PXInt) or multiple special attributes.
The code fix does the following:
- For a field type attribute, leaves the selected attribute and removes all other field type attributes
- For a special attribute, leaves the selected attribute and removes all other special attributes
The code fix is not available for the errors found for the attributes derived from the PXAggregateAttribute
.
public class DAC: PXBqlTable, IBqlTable
{
#region Property
public abstract class property : IBqlField { }
[PXDBBool] // The PX1023 error is displayed for this line.
[PXInt] // The PX1023 error is also displayed for this line.
// Either PXDBBool or PXInt must be removed.
public virtual bool? Property{ get; set; }
#endregion
}
public class DAC: PXBqlTable, IBqlTable
{
#region Property
public abstract class property : IBqlField { }
[PXDBBool]
public virtual bool? Property{ get; set; }
#endregion
}