Skip to main content
Answer

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

  • October 24, 2023
  • 2 replies
  • 77 views

aaghaei
Captain II
Forum|alt.badge.img+10

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.

Best answer by aaghaei

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) { }

 

2 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • Answer
  • October 24, 2023

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) { }

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • October 24, 2023

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