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)

Updating ReqDateDlv field in ReqPO table

(0) ShareShare
ReportReport
Posted on by

I've developed this piece of code to update delivery dates for planned transfer orders.

It seems to work on a small subset orders but will stop updating the table at ~2000 records but the output is showing all of the fields as being updated.

If anyone has any suggestions that would be great!

static void updateDeliveryDate(Args _args)
{
    ReqPO       reqPO;
    ReqTrans    reqTrans;
    date        dlvDate = str2Date('11/05/2017', 123);

    while select forUpdate reqPO
        join reqTrans
            where reqPO.RefId == reqTrans.RefId
                && reqPO.RefType == reqTrans.RefType
                && reqPO.PlanVersion == reqTrans.PlanVersion
                && reqPO.RefType == 34

    {
        reqPO.ReqDateDlv = dlvDate;
        reqPO.update();
        info(strFmt("Item ID: %1, Delivery Date: %2", reqPO.ItemId, reqPO.ReqDateDlv));
    }
}

*This post is locked for comments

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

    Well, first of all I cannot see a TTS block around your transaction, which is required for update operation, so I assume you do it outside of this method. If not, then that is missing and required.

    The AX InfoLog has a limit on how many messages can be displayed, it is set in the User Options, maybe that is why you only see 2000 info entries? If that is not the case, have you done a count(RecId) with the same selection criteria to get an exact number on how many records are you about to update?

  • Community Member Profile Picture
    on at

    I have been using the TTS block in the actual development (the job above is a test to see why it's not working). I forgot to add it into this, I've just added it and still no joy. Some of the records update and some don't.

    The limit in the environment I'm working on is 10000 for the info log. So I'm definitely seeing all of the records. But in the info log it shows the updated date.

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