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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Batch Job parameter - formula on date

(0) ShareShare
ReportReport
Posted on by

My company wants to run Recalc Inventory as a periodic scheduled batch job at 1:00 am each night. We need to be able to specify one of the parameters - "Recalculate inventory up to" to be the current date of the job minus one day.

The form does not allow a date formula, or for that matter, anything other than a finite date chosen from the Date/Calendar choice popup.

Any help please????

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    What we did for the exact same reason in AX 2012 was to change the Batch framework. We have created a setup form, where we record that which AX RunBase Class or SysOperation framework class do we want to offset the date for, what packed variable holds the date, and by what recurrence range and value do we want to offset the date when the batch is re-scheduled.

    Then we have changed the batch framework, where the task would be rescheduled based on the recurrence settings, and if the class id of the batch job matches one of the setups, we have repacked the date variables with the changes offset value.

    This way we got a universal solution for all fixed date-based batch jobs, not to schedule them manually ever again.

    You could try to use similar concepts to do the same in AX 7.

  • Guy Terry Profile Picture
    28,924 Moderator on at

    Hi Ghicks,

    Does the form not have a 'Period code' field, which you can use to calculate the 'Recalculate up to' date?

  • Community Member Profile Picture
    on at

    Hello,

    I know this post is a little old, but we have run into the exact same requirement.  We need to program a daily batch job for inventory recalculation with the "up to date" parameter being relative to the current date.  The Date parameter doesn't accept relative functions such as (day(0)).

    We would like to avoid customisations for this if at all possible.  I have looked at using a period code with no success.  Maybe I don't know how to set it up properly to generate the current date in the "up to" date parameter.

    Does someone have the recipe?

    Thanks.

    Denis.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Denis, the Inventory closing supports the date period codes:

    technet.microsoft.com/.../aa619451.aspx

    Recalculation apparently does not:

    technet.microsoft.com/.../aa600651.aspx

    In the Date Period you have 2 columns, one is for offsetting the start date, and the right column is for offsetting the end date. In case of "up to", you just need to provide something like "days" with sign "-" and value "7".

    We have scheduled our inventory closing batch to run every Saturday, this way on each execution the batch will close inventory up until the previous Saturday.

    Your technical team needs to look at the code for inventory closing and how it uses the Period codes, and implement it in a similar fashion for Inventory recalculation. I am afraid there are no other ways around this, unless you customize the batch framework to be able to offset any dates like I have suggested above. But that would be more effort than specifically targeting just recalculations to use the period code.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans