acumatica Creating Date and Time Fields in Acumatica The PXDBTimeSpan Attribute

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

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

#region UsrTimeInt
public abstract class usrTimeInt : IBqlField
{ }

[PXDBTimeSpan(DisplayMask = "t", InputMask = "t")]
[PXUIField(DisplayName = "Time Value")]
public int? UsrTimeInt { get; set; }
#endregion

In the UI, for a field decorated with PXDBTimeSpanAttribute the system creates a drop-down with half hour interval values both on a form:

enter image description here

and within a grid cell:

<px:PXDateTimeEdit runat="server" ID="edUsrTimeInt" DataField="UsrTimeInt" TimeMode="true" />

enter image description here

<px:PXGridColumn DataField="UsrTimeInt" Width="90px" TimeMode="true" />


Got any acumatica Question?