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, ...
Unanswered

Customization on Inventory Aging Report

(0) ShareShare
ReportReport
Posted on by 67

Module / report path: Inventory Management → Inquiries and reports → Physical inventory reports → Inventory aging (InventAging SSRS report, data provider class InventAgingDP)

Goal

Add a custom report parameter, Evs_HideZeroLines, to the standard Inventory Aging report. When turned on, lines with an on-hand quantity of 0 should be excluded from the printed output. When off (default), the report should behave exactly like standard.

The parameter itself was added via a class extension on InventAgingContract and works fine on the dialog. The issue is filtering InventAgingTmp (the temp table backing the report dataset) before it renders.

Relevant standard code:

 
xpp
[SRSReportDataSetAttribute(tableStr(InventAgingTmp))]
public InventAgingTmp getinventoryAgingTmp()
{
    InventAgingTmp        inventoryAgingTransTmp;
    inventoryAgingTransTmp.setConnection(this.parmUserConnection());
    select inventoryAgingTransTmp;
    return inventoryAgingTransTmp;
}

Attempt 1 — PostHandlerFor on processReport()

 
xpp
class Evs_InventAging_DPPostHandler
{
    [PostHandlerFor(classStr(InventAgingDP), methodStr(InventAgingDP, processReport))]
    public static void InventAgingDP_Post_processReport(XppPrePostArgs args)
    {
        InventAgingDP        dp       = args.getThis();
        InventAgingContract  contract = dp.parmDataContract() as InventAgingContract;
        if (contract && contract.parmEvs_HideZeroLines())
        {
            InventAgingTmp tmp = dp.getinventoryAgingTmp();
            ttsbegin;
            while select forupdate tmp
            {

                    if (tmp.QtyOnHand == 0)
                    {
                        tmp.delete();
                    }
                
            }
            ttscommit;
        }
    }
}

Result: Handler fires, the matching row is found, tmp.delete() executes without error — but the printed report still shows the same "6.00" line, unchanged.

Attempt 2 — ExtensionOf on getinventoryAgingTmp()

 
xpp
[ExtensionOf(classStr(InventAgingDP))]
final class Evs_InventAgingDP_Extension
{
    public InventAgingTmp getinventoryAgingTmp()
    {
        InventAgingContract contract = this.parmDataContract() as InventAgingContract;
        InventAgingTmp      inventoryAgingTransTmp = next getinventoryAgingTmp();

        if (contract && contract.parmEvs_HideZeroLines())
        {
            select inventoryAgingTransTmp
                where inventoryAgingTransTmp.QtyOnHand != 0;
        }

        return inventoryAgingTransTmp;
    }
}

Result: Debugger doesn't break inside this method at all, and the printed report is unchanged. No errors reported.

This is my first time working on customizing a System report, please help me as nothing I have tried is working or showing any change.

For testing purposes, If you refer to the attached report, I changed my if condition to 6.00 quantity but still no changes showed in the specific data.

Categories:
  • Martin Dráb Profile Picture
    240,655 Most Valuable Professional on at

    I don't think that filtering in getInventoryAgingTmp() will have any effect.

     

    Deleting rows sounds good to me, if we cannot prevent record inserts in the first place, which would be more efficient.

     

    I don't know why it doesn't work for you, though. How exactly do you determine that the line is displayed in the report? It's not clear to me from the the current description. Also, please check the content of the table buffer returned by getInventoryAgingTmp() at the end of your extension of processReport(). Do you see the records there or not? 

     

    By the way, don't use PostHandlerFor. Prefer CoC. Then you easily call this.getinventoryAgingTmp(), for instance.

  • Subra Profile Picture
    2,175 Super User 2026 Season 2 on at

    Hi @SA-15031413-0 

    DP class extension is correct approach if you want to change your business logic.

    Did the standard process report method has been triggered and did you enabled all the debugging options in your environment? Debugging is not working only for this customziation?





     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 378 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 350

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 345 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans