Hi,
I created a dac extension in the POLine, I add the field the grid and when save the document , the records is inserted in the db. Bu when retrieve the PO the new field is empty.
How I can populate the new field?
Thanks,
Hi,
I created a dac extension in the POLine, I add the field the grid and when save the document , the records is inserted in the db. Bu when retrieve the PO the new field is empty.
How I can populate the new field?
Thanks,
Best answer by Fernando Amadoz
You are managing the extended DAC as a separate table instead of adding the fields to Acumatica’s POLine table.
This is a valid approach. And it is correct in these cases the use of the attribute [PXTable] in order to indicate Acumatica that it’s a “Joined” table.
However, you seem to be adding additional attributes that are not needed for a CacheExtension (e.g. [PXCacheName]) and you are redefining native fields that should not be added to the DAC extension (e.g. NoteID, OrderType, OrderNbr, etc)
Try a simplified approach adding only the extra fields: QtyCases and QtyLbs.
You are correct in adding CompanyID and the primary key in the DB table definition, but it is not needed in the DAC extension definition.
Please see this reference from a project we worked on a couple of years ago (you may have to add the IsActive() method)
using PX.Data;
using PX.Objects.AR;
using PX.Objects.CR;
namespace ProjectNameSpace
{
[PXTable(typeof(BAccountR.bAccountID), IsOptional = true)] //IsOptional ==> it's managed as a Left Join
public class CustomerExt : PXCacheExtension<Customer>
{
#region LCID
public abstract class lCID : PX.Data.IBqlField
{
}
[PXDBInt()]
[PXUIField(DisplayName = "Field Name")]
public virtual int? LCID { get; set; }
#endregion
}
}
Notice that the DAC extension only adds the LCID field.
However, my DB table also included CompanyID, BAccountID (primary key), and *DeletedDatabaseRecord
*Only needed if defined in the original table. POLine does not have it
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.