Hi,
I am attempting to add new fields to the VendTransOpenPerDate Report by extending the VendTransOpenPerDateDP class. I am using CoC and implementing my change in the setVendTransOpenStmtTmp(). The problem I am running into is that the vendTransOpenStmtTmp table is declared as a private variable in the standard class.
I have noticed that there is a getVendTransOpenStmtTmp() on the DP class which I have attempted to leverage in order to get the correct table buffer, but this results in the report returning no data.
Other solutions I have tried is to add my logic to the insertVendTransOpenStmtTmp() on the DP extension, but I am unable to get context of VendTrans and VendTable in this method as the get* methods for these 2 tables are also private.
I also tried setting the standard setVendTransOpenStmtTmp() fields in my CoC field, this does return the correct data in the sense of the report included the standard fields as well as my new fields but there are some fields I am unable to access still due to private declarations and it duplicates some of the rows.
I have added my extension class code below
If anyone has any experience extending this DP class or might have some guidance it would be greatly appreciated.
[ExtensionOf(classStr(VendTransOpenPerDateDP))]
final class KRCVendTransOpenPerDateDP_Extension
{
protected void setVendTransOpenStmtTmp(VendTable _vendTable, VendTrans _vendTrans)
{
DimensionDefault defaultDimension;
DimensionAttribute project;
DimensionValue ProjectVal;
ProjName projName;
#define.Project('Project')
next setVendTransOpenStmtTmp(_vendTable, _vendTrans);
CustVendTransOpenStmtTmp _vendTransOpenStmtTmp = this.getVendTransOpenStmtTmp();
DimensionAttributeValueSetStorage dimStorage = new DimensionAttributeValueSetStorage();
defaultDimension = _vendTrans.DefaultDimension;
dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
project = DimensionAttribute::findByName(#Project);
projectVal = dimStorage.getDisplayValueByDimensionAttribute(project.recId);
projName = ProjTable::find(projectVal).Name;
_vendTransOpenStmtTmp.KRCProjName = projName;
_vendTransOpenStmtTmp.KRCVendGroup = _vendTable.VendGroup;
_vendTransOpenStmtTmp.KRCTaxAmount = TaxTrans::find(_vendTrans.Voucher, _vendTrans.TransDate).TaxAmount;
}
}