Solved

How to override a field DisplayName that does not exist in DAC and verify its value?

  • 24 October 2023
  • 2 replies
  • 27 views

Userlevel 7
Badge +8

Hello all,

 

I have come across a special need that requires changing of “Time” field in EP317000. The graph is EPWeeklyCrewTimeEntry, the DAC is EPActivityApprove (driven from PMTimeActivity) and the field in question is Date. This is one of those fields that has DateTime value but in the UI Date part and Time Part are displayed in two different columns of the grid. Out of the box, these two fields carry a DisplayName of the “Date” and the “Time” that absolutely makes sense. But for a very good business case reason, we need to change the “Time” column DisplayName to “Hours”. When I look at the field property on the UI the platform assigns “Date_Time” name to the “Time” column but in reality, such a field does not exist at all. So the question is how can I change the name of a field that does not exist in DAC. Just to be clear I am not referring to bound and unbound properties. The “Date_Time” is a made up column name that does not exist in DAC. I need to 1) change the DisplayName presumably using CacheAttached or Initialization and 2) write a FieldVerifying event to perform some validations and make required changes to the data that we will be uploading to this screen.

 

Any help is appreciated.

icon

Best answer by aaghaei 24 October 2023, 09:15

View original

2 replies

Userlevel 7
Badge +8

I figured it out. Here is what I did.

 

[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDBDateAndTime(DisplayNameDate = "Date", DisplayNameTime = "Hours")]
protected virtual void EPActivityApprove_Date_CacheAttached(PXCache cache) { }

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @aaghaei!

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