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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Getting Physical inventory Posted amount as on todays date

(0) ShareShare
ReportReport
Posted on by 353

Hi -

    I have a requirement to work on Inventory Value Report. I have to customize the existing report in AX 2012 "InventValue" to add a logic that will insert a new column on the report which will output the values of Physical Inventory Amount as per the current date. The current date is the date when you are Executing the report.

As of now the report pulls out the physical inventory amount totals for the previous month. I have to add a new column which will display the physical inventory total amount of the date/month I'm executing the report. this way we can compare the amount changes(Variance) of our inventory from last month and as of today.

For now I have added a new column in InventValueReportTempLine table which will store the physical Inventory Amount as on todays date.

I have customized the InventValueDP class and InventValueReportPopulateItem class.

Method customized in InventValueReportPopulateItem class

1. updateReportLineBalance (I have added my code in this method to populate the report with my new columns data)

2. getCurrentDateAmountValue () this is my original method to get the values of Physical Inventory amount as of current date.

4846.Capture.JPG

public CostAmount getCurrentDateAmountValue()
{
  InventValueReportTmpLine inventValueReportTmpLine;

  select * from inventValueReportTmpLine
   order by inventValueReportTmpLine.TransDate desc
      where inventValueReportTmpLine.TransDate == today() ||
    inventValueReportTmpLine.TransDate != str2Date('',213);

  inventValueReportTmpLine.CurrentDatePhysicalPostedAmountValue = inventValueReportTmpLine.InventoryPhysicalPostedAmount;
  return  inventValueReportTmpLine.CurrentDatePhysicalPostedAmountValue;
}

My understanding is that If I write the code correcttly for getCurrentDateAmountValue() which can return the physical inventory amount for the current date or closest date to the current date (Assuming if there is no data for inventory on the current date then the code should get the data for the first available date which has data) then I can store this value in the new field I have added in InventValueReportTempLine table and display in on the report.

Can you please suggest me the logic or how I can improve my code to fulfill my requirement here ?

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Muhammad_Ali Profile Picture
    353 on at
    RE: Getting Physical inventory Posted amount as on todays date

    Hakim -

     Thank You for your reply,

    One question though. If I actually make a new report then would I be just needing the InventValueReportTmpLine Table to populate my report ? is this table the only table I would need for this report  ? is it just a matter of getting the data from the table (according to the parameters) and displaying in on the report ?

    Thanks

  • Mahmoud Hakim Profile Picture
    17,887 on at
    RE: AX 2012: Invent Value Report : Added a new Field to get the value of Physical Inventory Posted Amount as per today's date. How to code this logic to get the Physical inventory Posted amount as on todays date ?

    i think if you design a new report , it will be easier than from editing in this report.

    this is report is very complicated

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans