Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 2.17 KB

PX1023.md

File metadata and controls

57 lines (43 loc) · 2.17 KB

PX1023

This document describes the PX1023 diagnostic.

Summary

Code Short Description Type Code Fix
PX1023 The DAC property is marked with multiple field type attributes. Error Available

Diagnostic Description

The diagnostic verifies the following rules:

  • The DAC property field must have only one field type attribute, such as PXDBBool or PXInt.
  • The DAC property field cannot have multiple special attributes, such as PXDBCalced and PXDBScalar.
  • If the DAC property has an attribute derived from the PXAggregateAttribute, this attribute cannot aggregate incompatible field type attributes (such as PXBool 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.

Example of Incorrect Code

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
}

Example of Code Fix

public class DAC: PXBqlTable, IBqlTable
{
    #region Property
    public abstract class property : IBqlField {    }
 
    [PXDBBool]
    public virtual bool? Property{ get; set; }
    #endregion
}

Related Articles