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; } }
Hi Mohit,
Thank you for your response, the private variable in this case is the Temp Table declaration in the standard DP class.
Bharani suggested I use a eventhandler and this did indeed solve my problem.
Hi Bharani,
I did indeed not think of this... I have implemented your suggestion of using an onInserting event handler and it works perfectly. Thank you for your speedy and helpful response.
Hi Justin, setVendTransOpenStmtTmp method seems to be right choice. May I know which private fields you need to access and how come extending this method will create duplicate rows.
Have you tried oninserted or oninserting event handler?
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156