EDIT: I wish I could edit the Title for this question...It should be How do I get access to another cache inside a FieldUpdated handler
I added User Defined fields to the Details tab of the Employee Time Card Entry screen EP305000.
The fields pull data from custom maintenance tables. It is working.
The table that the UDF’s are stored in is the PMTimeActivity table. That is the table that holds the Details grid data.
The graph extension for the screen isÂ
   public class TimeCardMaint_Extension : PXGraphExtension<TimeCardMaint>
Â
In the extension, I grab the customer ID that is selected using the FieldUpdating handler for the UsrCustomerID field.
My current code can only get the DAC extension for PMTimeActivity if the record has been saved. I get the reference to the extension using a BQL statement. I highlighted in red the code that gets the PMTimeActivity extension.
If the row is not saved, tcd will always be null.
namespace PX.Objects.EP
{
   public class TimeCardMaint_Extension : PXGraphExtension<TimeCardMaint>
   {
      #region Event Handlers
      protected void EPTimecardDetail_UsrCustomerID_FieldUpdating(PXCache cache,      PXFieldUpdatingEventArgs e)
      {
         var row = (EPTimecardDetail)e.Row;
       PMTimeActivity tcd = SelectFrom<PMTimeActivity>.Where<PMTimeActivity.noteID.IsEqual<@P.AsGuid>>.View.Select(Base, row.RefNoteID);
         if (tcd == null) return;
Â
The cache for this handler shows this:Â
The DAC extension that stores the UDF values is
   public class PMTimeActivityExt : PXCacheExtension<PX.Objects.CR.PMTimeActivity>
   {
      #region UsrCustomerID
      eCustomer]
      ÂPXUIField(DisplayName = "Customer")]
      ÂPXRestrictor(typeof(Where<BAccount.parentBAccountID, IsNotNull>), ICSMessages.ParentAccount)]
      public virtual int? UsrCustomerID { get; set; }
      public abstract class usrCustomerID : PX.Data.BQL.BqlInt.Field<usrCustomerID> { }
      #endregion
Â
How can I get a reference to the PMTimeActivity DAC extension (cache) inside of this handler? It HAS to exist or the UDF fields on the screen wouldn’t show the values as they are selected.