This document describes the PX1078 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1078 | The DAC field and the referenced field have different types or sizes | Error | Unavailable |
The diagnostic verifies the following rules for properties that reference the foreign DAC field:
- The property should have the same CLR type as the foreign DAC property.
- The property and the foreign DAC property should have the same size if the data type attribute on the original DAC field allows to specify the size.
The diagnostic does not check following edge cases:
- Either of properties has several data type attributes with different sizes.
- Either of properties has data type attributes incompatible with the CLR type.
- The foreign DAC property does not have the data type attribute specified.
public class DAC: PXBqlTable, IBqlTable
{
#region Property
public abstract class property : IBqlField { }
[PXDBString(16)] // The PX1078 error is displayed for this line.
[PXSelector(typeof(SYSubstitution.substitutionID))] // The property has the data type attribute `[PXDBString(25)]`.
public virtual string Property { get; set; }
#endregion
#region OtherProperty
public abstract class otherProperty : IBqlField { }
[PXDBInt] // The PX1078 error is displayed for this line.
[PXSelector(typeof(SYSubstitution.substitutionID))] // The property has the data type attribute `[PXDBString(25)]`.
public virtual int? OtherProperty { get; set; }
#endregion
}