Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Running inventory recalculation as batch job

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

dear ,

We have configured the Inventory recalculation routine to run in a batch scheduled once everyday. However we have noticed even though the batch is running successfully as scheduled but the effective "Recalculate stock up to date" of recalculation date is not changing. On every iteration of recalculation Ax is using the same date (date we configured the batch) instead of dynamically changing the effective date to current date.

I am wondering how do I configure batch to dynamically change the "Recalculate stock up to date? We are on Ax 2012 r3 .

3731.Untitled.jpg

Regards

Mohamed Abd Elnabi

*This post is locked for comments

  • RE: Running inventory recalculation as batch job

    I would prefer to check first if it is in batch mode or client mode

    With that code you will enforce always get today's date for all scenario

    Means if someone need to run manually to specific date not today then it become impossible

    If I am not mistaken the checking would be isinbatch()

    If yes use today's date else take the transdate passed from the form parameter

    Another way to add parameter checkbox to say 'use current date' as a flag to determine run from form parameter date or get system date

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Running inventory recalculation as batch job

    dear ,,

    Any help on this question
    Thanks
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Running inventory recalculation as batch job

    this the source code for recalculation

    47427.Untitled.jpg

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Running inventory recalculation as batch job

    dear Crispin

    What is the change in this code?

    this is the path

    \Forms\InventAdjTransaction\Designs\DesignList\Post\Methods

    form of source : InventAdj_Transact.run();

    this is code :

    void clicked()

    {

       InventClosing       inventClosing;

       InventAdj_Transact  inventAdj_Transact;

       // <GEERU>

       inventAdj_Transact = InventAdj_Transact::newTransact(dataAdjTransact.pack(),inventTransCurrency);

       // </GEERU>

       if (!inventAdj_Transact.prompt())

       {

           return;

       }

       inventAdj_Transact.run();

       super();

       if (element.args().caller() && element.args().dataset() == tableNum(InventClosing))

       {

           inventClosing= element.args().record();

           if (inventClosing.isFormDataSource())

           {

               inventClosing.dataSource().research();

           }

       }

       element.close();

    }

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans