acumatica Creating Date and Time Fields in Acumatica The PXTimeList Attribute


The PXTimeList attribute is designed to work with a DAC field of the Nullable<int> (int?) type and store time span value inside a DAC field as a number of minutes:

#region UsrTimeSpan
public abstract class usrTimeSpan : IBqlField
{ }

[PXUIField(DisplayName = "Time Span")]
public int? UsrTimeSpan { get; set; }

In the UI, for a field decorated with PXTimeListAttribute the system creates a drop-down with 30-minute interval values both on a form:

enter image description here

<px:PXTimeSpan ID="edUsrTimeSpan" runat="server" DataField="UsrTimeSpan" InputMask="hh:mm" />

and within a grid cell:

enter image description here

    <px:PXTimeSpan ID="edgUsrTimeSpan" runat="server" DataField="UsrTimeSpan" InputMask="hh:mm" />
    <px:PXGridColumn DataField="UsrTimeSpan" Width="90px" RenderEditorText="True" />