EDIT: partially fixed the issue - see my next post for the “new” issue.
I have a 3 digit fixed length field on my grid. I want to ensure that the value entered is 3 characters exactly.
I used a PXUIVerify to ensure the length of the value in the field is 3 characters.
#region Lower
[PXDBString(3, IsFixed = true, IsKey = true, InputMask = "###")]
[PXUIField(DisplayName = "Lower")]
[PXUIVerify(typeof(Where<Length<ICSFSSScheduleLine.lower>, Less<Length3>>), PXErrorLevel.Error, ICSMessages.ZipIsNotANumber, typeof(string))]
public virtual string Lower { get; set; }
public abstract class lower : PX.Data.BQL.BqlString.Field<lower> { }
#endregion
Here is the definition for “Length3”:
public static class ICSConstants
{
public const int Length3 = 3;
}
public class Length3 : PX.Data.BQL.BqlInt.Constant<Length3>
{
public Length3() : base(ICSConstants.Length3)
{
}
}
If you enter 010 (which is valid), you still get an error:

I could try using FieldVerifying on the field, but I think it is much better to handle this at the DAC level. I don’t see why my code is not working.