Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / customize standard Inv...
Finance forum
Unanswered

customize standard InventAging report

Posted on by 125
Hi there, here I am going to add three columns in the InventAging report as vendor code, vendor name and vendor group
But I am unable to fetch the required values here through these code.
Can you please help me out?
 
 
  • Waed Ayyad Profile Picture
    Waed Ayyad 5,205 Super User 2024 Season 2 on at
    customize standard InventAging report
    Hi M_R,
     
    Is the issue resolved? Did you try Martin's suggestion " Test it with hard coded values?"
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    customize standard InventAging report
    A problem isolation is still your main problem. That a reports shows no data may be caused by the report itself, not the data. Test the report with hard-coded values (e.g. added in insert() to verify that it can ever show values of your custom fields. If not, you need to fix the report, not the data provider.
     
    By the way, I think you should put your code to an extension of InventAgingReportLines.findOrCreate(). It's the most logical place and performance will be much better (because you won't need to process all lines again).
  • M_R Profile Picture
    M_R 125 on at
    customize standard InventAging report
    while debugging it is showing the values, but when we print the report it is showing blank as no values are coming.
  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,538 Moderator on at
    customize standard InventAging report
    Your code seems okay but to say if it is working, as everyone suggested, you need to debug it. You need to understand if extension is getting triggered, then check what values the code is returning like let's say the vendor group or name. Then you can have some more idea and understand exact issue.
  • Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    customize standard InventAging report
    You really need to use the debugger to find out where your code fails. Please tell us if you don't know how to do it; we can help you.
     
    Start by putting a breakpoint at the line with insert() and check if the fields are populated as expected. If not, look at the other variables. For example, maybe you already failed to find the VendTable record, or maybe even the InventTable record. When you know which values are wrong, continue your debugging to find out why. If you can't resolve the problem on your own, share all the information you collected with us.
     
    As you see, just trying to guess what's wrong is not a good approach. You made no progress with that, so maybe you should start taking our advice seriously.
  • M_R Profile Picture
    M_R 125 on at
    customize standard InventAging report
    I am going to add three columns in the InventAging report as vendor code, vendor name and vendor group. 
    But not getting the values of vendor code, vendor name and vendor group through this code
     
    [ExtensionOf(classstr(InventAgingDP))]
    final class ABCInventAgingDP_Extension
    {
        public void processReport()
        {
            next processReport();
            InventAgingTmp  inventAgingTmpabc = this.getinventoryAgingTmp();

            ttsbegin;
            while select forupdate inventAgingTmpabc
                      
                InventTable inventTable = InventTable::find(inventAgingTmpabc.ItemId);
                inventAgingTmpabc.AccountNum =inventTable.PrimaryVendorId;
                inventAgingTmpabc.PackagingGroupId = inventTable.PackagingGroupId;

                //VendTable vendTable;
                VendTable vendTable = VendTable::find(inventTable.PrimaryVendorId);
                inventAgingTmpabc.Name = vendTable.name();
                inventAgingTmpabc.VendGroup =vendTable.VendGroup;
                inventAgingTmpabc.update();

                //if (InventTable)
                //{
                //inventAgingTmpabc.AccountNum = inventTable.PrimaryVendorId;
                //VendTable = VendTable::find(inventAgingTmpabc.AccountNum);
                //if (VendTable)
                //{
                //inventAgingTmpabc.Name = vendTable.name();
                //inventAgingTmpabc.VendGroup = vendTable.VendGroup;
                //}
                //inventAgingTmpabc.PackagingGroupId = InventTable::find(inventAgingTmpabc.ItemId).PackagingGroupId;
           

            }
            ttscommit;
                
          }
    }
  • Waed Ayyad Profile Picture
    Waed Ayyad 5,205 Super User 2024 Season 2 on at
    customize standard InventAging report
    Hi @M_R,
     
    Do you mean that the values for the custom fields weren't filled correctly? Can you provide more details about the issue?
  • Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    customize standard InventAging report
    Why not? Are you saying that you know how to run code in debugger but otherwise you have no idea how to use it, such as how to see whether your code got called and whether variables have the expected values?
  • M_R Profile Picture
    M_R 125 on at
    customize standard InventAging report
    found this while debugging



  • Martin Dráb Profile Picture
    Martin Dráb 228,212 Most Valuable Professional on at
    customize standard InventAging report
    Please tell us what you mean by "I am unable to fetch the required values here through these code". What did you find when you debugged your code?

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,349 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,212 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans