Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1.31 KB

PX1002.md

File metadata and controls

38 lines (29 loc) · 1.31 KB

PX1002

This document describes the PX1002 diagnostic.

Summary

Code Short Description Type Code Fix
PX1002 The field must have a type attribute that corresponds to the list attribute. Error Available

Diagnostic Description

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.

Example of Incorrect Code

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

Example of Code Fix

public class SomeDAC : IBqlTable
{
    public abstract class someField { }
    [PXStringList(new[] { "O", "N" }, new[] { "Open", "New" })]
    [PXStringAttribute]
    public string SomeField { get; set; }
}