web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Add new field to VendTransOpenPerDate Report by extending VendTransOpenPerDateDP class

(0) ShareShare
ReportReport
Posted on by 186

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;

    }

}

I have the same question (0)
  • Verified answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at

    Have you tried oninserted or oninserting event handler?

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    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.

  • Suggested answer
    Justin Kruger Profile Picture
    186 on at

    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.

  • Justin Kruger Profile Picture
    186 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 509 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 375

#3
Adis Profile Picture

Adis 268 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans