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)

Automatic table update for everyday in Ax 2009

(0) ShareShare
ReportReport
Posted on by 3,732

Hi,

I have a table named as "SOP" in that I have fields are "Release date", and so on. I'm working on the revision.

Table-2.png 

What is my question means. When ever the "release date" is equal to the system date then "Active" field should be enable until the next revision "release date" come. If next revision date comes means then that have to come to active the previous one have to go inactive. I have a code for this scenario. But I don't know in which method I have to write the code. Can you tell me which method is the right one for this scenario in table.

For this scenario that code have to execute for every day to check the release date. 

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    before answering question, "what if new coming RelaseDate is not equal to today?? should it make itself active and previous dates inactive?? because coming release data is not today. As you said in your first condition that if release date is equal to today"

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Sohaib,

    • If release date is not equal to today date means it should in inactive state.
    • If release date is equal to today means it should go active, util the new release date come.
    • If release date is previous date to today means is should be in inactive state.

    Thanks for you reply Sohaib, I need to know which method update the table eventually (For every moment) by seeing the date.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    man, you need to write a batch class. Batch class periodically runs based on reoccurance setup

    heave a look at following examples

    tech.alirazazaidi.com/exploring-the-batch-job-process-in-dynamics-ax-2012-r3

    www.atomicax.com/.../create-batch-executable-class

    and in AOT>>Classes >>Tutorial_RunbaseBatch

    create a RubBaseBatch class an put your logic there. then add it to batch jobs and after every few minutes it can check your table to do whatever you want

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Sohaib,

    Where to set the batch job timing? (When this batch job should run or should I go to job and run manually?) I'm using Ax 2009. 

    Other than that is there any other way to achieve my scenario?

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    Hi after creating class, as you will run it through a menu item or otherwise, It will provide you option to set reoccurrence.

    kindly open class Tutorial_RunbaseBatch and press Ctl+O on it

    BJ.png

    the class Tutorial_RunbaseBatch, can also be found on AX2009

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hi Sohaib,

    Once I set the batch, that time its running. But I have to set the date as "No end date". But this scenario is not working. I set time interval as 1 minute.

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    you can set time interval as per you need 1 minute 10 minutes, 1 hour 1 day anything.

    there is choice to select different sort of intervals. you may choose as per needs. after setting time click ok, click okay gain to close dialog which was opened as result of running class, its will add a new job in batch jobs and will execute periodically

  • syed baber Profile Picture
    11,633 on at

    Hi Sathish,

    If you want to run the batch job for indefinite period as per the defined interval, then I think there is an option of 'No end date' when you click the Recurrence button. Please check after clicking the Recurrence button and see if there is an option related to this.

    Thanks,

    Baber.

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