how to get more than 24 hrs in a PXTimeList Dropdown Field??
Hi, I developed new screen. Inside that added one new Field “Labor Time Hrs” which consist of PXTimeList Attribute. Currently PXTimeList is showing up to 24:00 Hrs.
How to customize that Field to show More than 24 Hrs in a Time dropdown. Thanks Giri.
Page 1 / 1
Hey Giri, I hope you are doing well!
The default TimeList attribute will provide you only 24 Hrs. We need to customize if you want to show more than 24 Hrs.
I just worked on it and please find the customized attribute and screenshot for your reference.
In the below example, I’ve added up to 30 hours. If you want to show more than 30 hours you can increase the values in GetValues(30, 60).
SOOrder Extended DAC
public class SOOrderExt : PXCacheExtension<SOOrder> { PXDBInt] UsrPXTimeListAttribute] PXUIField(DisplayName = "Time Span")] public int? UsrTimeSpan { get; set; } public abstract class usrTimeSpan : IBqlField{ }
}
Customized Attribute
public class UsrPXTimeListAttribute : PXIntListAttribute { public override bool IsLocalizable { get { return false; } }
public UsrPXTimeListAttribute() : base(UsrPXTimeListAttribute.GetValues(30, 60), UsrPXTimeListAttribute.GetLabels(UsrPXTimeListAttribute.GetValues(30, 60))) { }
public UsrPXTimeListAttribute(int step, int count) : base(UsrPXTimeListAttribute.GetValues(step, count), UsrPXTimeListAttribute.GetLabels(UsrPXTimeListAttribute.GetValues(step, count))) { }