This document describes the PX1060 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1060 | DAC fields should be strongly typed to be used in fluent BQL queries. | Warning | Available |
The PX1061 diagnostic detects weakly-typed DAC BQL fields that do not support FBQL queries.
Each DAC BQL field (that is, each public abstract class of a DAC) that is used in fluent BQL is strongly typed, which makes it possible to perform compile-time code checks in Visual Studio.
In fluent BQL, you derive class fields not from the IBqlField interface (as you would in traditional BQL) but from the specific fluent BQL classes that correspond to the type of the property field.
The PX1060 code fix changes PX.Data.IBqlField to PX.Data.BQL.Bql[Type].Field<productID>, where [Type] is one of the following:
Bool, Byte, Short, Int, Long, Float, Double, Decimal, Guid, DateTime, String, or ByteArray.
public class Product : PX.Data.PXBqlTable, PX.Data.IBqlTable
{
#region ProductID
public abstract class productID : PX.Data.IBqlField // The PX1060 message is displayed for this line.
{
}
protected int? _ProductID;
[PXDBIdentity]
public virtual int? ProductID
{
get
{
return this._ProductID;
}
set
{
this._ProductID = value;
}
}
#endregion
}public class Product : PX.Data.PXBqlTable, PX.Data.IBqlTable
{
#region ProductID
public abstract class productID : PX.Data.BQL.BqlInt.Field<productID>
{
}
protected int? _ProductID;
[PXDBIdentity]
public virtual int? ProductID
{
get
{
return this._ProductID;
}
set
{
this._ProductID = value;
}
}
#endregion
}