This document describes the PX1002 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1002 | The field must have a type attribute that corresponds to the list attribute. | Error | Available |
If you assign a list attribute to a DAC field, you have to assign the corresponding field type attribute to the field. For example, if a DAC field has the PXStringList
attribute, the field must also have the PXString
, PXDBString
, or an inherited from one of these two classes attribute.
The diagnostic supports DACs and DAC extensions.
In the code fix, the needed field type attribute is added.
public class SomeDAC : IBqlTable
{
public abstract class someField { }
[PXStringList(new[] { "O", "N" }, new[] { "Open", "New" })] // The PX1002 error is displayed for this line.
public string SomeField { get; set; }
}
public class SomeDAC : IBqlTable
{
public abstract class someField { }
[PXStringList(new[] { "O", "N" }, new[] { "Open", "New" })]
[PXStringAttribute]
public string SomeField { get; set; }
}