Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.32 KB

PX1014.md

File metadata and controls

39 lines (29 loc) · 1.32 KB

PX1014

This document describes the PX1014 diagnostic.

Summary

Code Short Description Type Code Fix
PX1014 A DAC field must have a nullable type. Error Available

Diagnostic Description

A DAC property field must have a nullable type (such as decimal? or DateTime?). After the system has retrieved the values from the database and merged the records with PXCache of the needed DAC type, particular fields of the DAC instance can contain null values. Therefore, for the system to work correctly, all DAC fields must be able to store null value.

The code fix changes the type of the DAC property field to the corresponding nullable type.

Example of Incorrect Code

public class SOOrder : PXBqlTable, IBqlTable
{
    public abstract class total : IBqlField { }
    [PXDBDecimal]
    public decimal Total { get; set; } // The PX1014 error is displayed for this line.
}

Example of Code Fix

public class SOOrder : PXBqlTable, IBqlTable
{
    public abstract class total : IBqlField { }
    [PXDBDecimal]
    public decimal? Total { get; set; }
}

Related Articles

Data Access Classes