Hello,
I am trying to add a custom field to the INSiteStatusByCostCenter DAC. I have been able to add the field and have it populated when I create an inventory adjustment. However, when I create an inventory issue, the value of the field is removed from the database. I have tracked it down to two places where I think this is happening but now I am stuck on how to get past it.
Problem 1:
In the SiteStatusByCostCenter DAC, the fields have their assign behavior set to summarize in the prepare insert of an Accumulator attribute. Is it possible to do this on my DAC extension?
protected override bool PrepareInsert(PXCache cache, object row, PXAccumulatorCollection columns)
{
if (!base.PrepareInsert(cache, row, columns))
{
return false;
}
columns.Update<qtyOnHand>(PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<qtyAvail>(PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<qtyHardAvail>(PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<qtyActual>(PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<qtyINIssues>(PXDataFieldAssign.AssignBehavior.Summarize);
columns.Update<qtyINReceipts>(PXDataFieldAssign.AssignBehavior.Summarize);
}
Problem 2:
I have found where the values are set in the code. It is in the Item Plan Helper > UpdateAllocatedQuantitiesBase method. I have overridden the INTranSplit(which implements this class) but I am getting a “The signature of a method with the PXOverride attribute must match the overridden method.” I do not know why this issue is occurring when I copied the parameters from the source code. Here is my code below.
public class INIssueEntry3_Extension : PXGraphExtension<IN.GraphExtensions.INRegisterEntryBaseExt.INTranSplitPlan, INRegisterEntryBase>
{
public delegate TNode UpdateAllocatedQuantitiesBaseDelegate<TNode>(TNode target, IQtyPlanned plan, INPlanType plantype, bool? InclQtyAvail, bool? hold, string refEntityType);
[PXOverride]
public TNode UpdateAllocatedQuantitiesBase<TNode>(TNode target, IQtyPlanned plan, INPlanType plantype, bool? InclQtyAvail, bool? hold, string refEntityType, UpdateAllocatedQuantitiesBaseDelegate<SiteStatusByCostCenter> baseMethod)
{
PXTrace.WriteInformation("Testing");
return target;
}
}
Thank you for your help!