0
votes

Very new to Acumatica and any explanation would be greatly appreciated.

I've added a new field via the DAC on the Projects screen. After the project is created, the field is populated with a custom project id which is an integer.

Here is the code:

namespace PX.Objects.PM
{
  public class ProjectEntry_Extension : PXGraphExtension<ProjectEntry>
  {
    #region Event Handlers
    protected void PMProject_RowInserted(PXCache cache, PXRowInsertedEventArgs e)
    { 
      var row = (PMProject)e.Row;
      row.UsrProjectID = 90000; //Custom Field with value
    }
    #endregion
  }
}

But when validating the project it returns the error:

\APP_CODE\Caches\ProjectEntry.cs does not contain a definition for 'UsrProjectID' and no extension method 'UsrProjectID' accepting a first argument of type 'PX.Objects.PM.PMProject' could be found (are you missing a using directive or an assembly reference?)

After checking the DAC, I found that the new fields were added to the DAC ContractExt.usrProjectID, how can I add it the PXProject DAC or call the field from the code event?

1

1 Answers

1
votes

You need to add the following line in order to access the DAC extension

ContractExt myext = PXCache<Contract>.GetExtension<ContractExt>(row);

myext.UsrProjectID =...