Solved

Displaying DateTime in PXSelector

  • 7 November 2022
  • 2 replies
  • 221 views

Userlevel 3
Badge +1

I would like to include the CreatedDateTime field in a PXSedlctor Dropdown, however I am having some challenges.

Initially I added some UI attributes to the standard CreatedDateTime field, this led to some confusing errors. So, I moved on to a non-priested read only field that would return the value of CreatedDateTime.

        [PXDateAndTime(DisplayMask = "G")]
public virtual DateTime? OrderSetDateTime { get { return CreatedDateTime; } }
public abstract class orderSetDateTime : PX.Data.BQL.BqlDateTime.Field<orderSetDateTime> { }

Using this method the date value shows but not the time. How would I show both in a single column?

 

Thanks 

icon

Best answer by andriikravetskyi35 8 November 2022, 14:59

View original

2 replies

Userlevel 6
Badge +4

Hi @Leif 

Just to clarify, Do you want to add that field as a column on a selector while selecting any other value? If that is the case you just need to specify the columns in the selector:

[PXSelector(typeof(Search<...>),
typeof( column 1 ),
typeof( column 2 ),
typeof( orderSetDateTime ),
...
)]

Also if the masks suggested by @andriikravetskyi35  are defined, you will have that specific display in the listing.

 

If this suggestion does not make sense, please share more details of what you want to accomplish. 

Userlevel 5
Badge +1

Hi,

I am not sure that it will help, but maybe add InputMask and DisplayMask in this way:

 

[PXDateAndTime(InputMask = "dd-MM-yyyy HH:mm:ss", DisplayMask = "dd-MM-yyyy HH:mm:ss")]    

 

or try to change attribute to :

[PXDBDate(PreserveTime =true)]

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved