This document describes the PX1021 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1021 | The type of the DAC field attribute does not correspond to the property type. | Error | Available |
The DAC property field must have a field type attribute that corresponds to the type of this property. For example, if a DAC property field has the PXDBInt
attribute assigned, the property must have the int?
type.
The code fix changes the property type so that it corresponds to the field type attribute. You can change the field type attribute manually to make it correspond to the property type.
public class SOOrder : PXBqlTable, IBqlTable
{
public abstract class orderDate : IBqlField { }
[PXDBInt] // The PX1021 error is displayed for this line.
[PXUIField(DisplayName = "OrderDate")]
public DateTime? OrderDate { get; set; } // The PX1021 error is also displayed for this line.
}
public class SOOrder : PXBqlTable, IBqlTable
{
public abstract class orderDate : IBqlField { }
[PXDBInt]
[PXUIField(DisplayName = "OrderDate")]
public int? OrderDate { get; set; } //The code fix changes DateTime? to int?. Instead, you can change PXDBInt to PXDateAndTime manually.
}