Solved

Cannot figure out how to get DAC Extension info on Time Card Entry screen

  • 22 December 2022
  • 1 reply
  • 113 views

Userlevel 6
Badge +3

I added UDFs to the EP305000 screen in the Details Tab.  You can see here that the data is saving to the DB as expected. (Customer, MEP ID, Advisor ID, Product Line ID)

I want to take the data after the hyphen in the Customer number field and put it into the Plan ID UDF.

When I added the fields, it created a DAC Extension in PMTimeActivity.

In the Project Editor, if I choose to add a handler on the Field Updated event for the Customer field,

 

It creates a graph Extension as here:

So, the DAC extension is as follows as 

public class PMTimeActivityExt : PXCacheExtension<PX.Objects.CR.PMTimeActivity>

but the graph extension is 

public class TimeCardMaint_Extension : PXGraphExtension<TimeCardMaint>

This obviously won’t compile as the cache is not PMTimeActivity, but rather it is EPTimecardDetail.

PMTimeActivityExt myExt = PXCache<EPTimecardDetail>.GetExtension<PMTimeActivityExt>(row);

How can I get a reference to the DAC Extension when the cache is different from what the graph is showing the cache should be?

icon

Best answer by Joe Schmucker 23 December 2022, 16:04

View original

1 reply

Userlevel 6
Badge +3

I figured it out.

 

        protected void EPTimecardDetail_UsrCustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
        {
            var row = (EPTimecardDetail)e.Row;

            PMTimeActivity tcd = SelectFrom<PMTimeActivity>.Where<PMTimeActivity.noteID.IsEqual<@P.AsGuid>>.View.Select(Base, row.RefNoteID);
            PMTimeActivityExt myExt = PXCache<PMTimeActivity>.GetExtension<PMTimeActivityExt>(tcd);

            cache.SetValue<PMTimeActivityExt.usrPlanID>(row, "TEST");
        }

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