Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 1.72 KB

PX1032.md

File metadata and controls

69 lines (55 loc) · 1.72 KB

PX1032

This document describes the PX1032 diagnostic.

Summary

Code Short Description Type Code Fix
PX1032 DAC properties cannot contain method invocations. Error Unavailable

Diagnostic Description

DACs cannot contain method invocations. DACs are the classes that are used to read and write data. Therefore, for appropriate program architecture and design, DACs cannot contain any application logic.

To fix the issue, you should remove method invocations from the DAC.

The diagnostic ignores invocations of the following methods:

  • Static methods inside DAC fields (that is, property getters and setters)

  • Methods declared on the following system types:

    • bool
    • byte
    • short
    • int
    • long
    • decimal
    • float
    • double
    • string
    • Guid
    • DateTime
    • TimeSpan
    • Enum
    • Nullable

Example of Incorrect Code

[Serializable]
public class POALCLandedCost : PXBqlTable, IBqlTable
{
    public abstract class hold : IBqlField { }

    protected bool? _Hold;

    [PXDBBool()]
    [PXUIField(DisplayName = "Hold", Visibility = PXUIVisibility.Visible)]
    [PXDefault(true)]
    public virtual bool? Hold
    {
        get
        {
            return this._Hold;
        }
        set
        {
            this._Hold = value;
            this.SetStatus(); // The PX1032 error is displayed for this line.
        }
    }

    protected virtual void SetStatus()
    {
    }
}

Related Articles

Data Access Classes