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)

Select one record at the time and update

(0) ShareShare
ReportReport
Posted on by 620

Hello everyone

I'm having a weird / annoying problem. Let me first tell what I am trying to do.
I have a table which contains 150 connections (these are comparable with houses that all have addresses). I need to update each of these connection rows to specify a sequenceId which is a column in this table.

The sequenceId comes from c# and works like a sharm.

I tried three different solutions and none of them works.

First the "while select", which should iterate over the 150 addresses and in the while I can process things.

Code example 1: http://gyazo.com/4aabe1768be54ca560c278f2db5de464.png

That didn't work so I tried a more solid solution, the for-loop which I am sure that it iterates 10 times (for testing purposes). But this time it doesn't switch the ConnectionId (which I want from every row so I can update one specific row).

Code example 2: http://gyazo.com/40a99d1de1c92c48bff38b976fa6756c.png

 

And last what I found here on the forum with the "next" in a while loop.

Code example 3: http://gyazo.com/79e5f186fad79f971872e95016025a27.png

 

Summary:
- first example only loops ones (if I do count() I get 150)
- second example loops 10 times, but doesn't change the connectionId
- third example loops also 10 times and doesn't change the connectionId either

I hope someone can help me. My appologies already if I did something stupid in the code examples but I'm learning AX for 2months now (on my own).

Sincerly,
Vincent

*This post is locked for comments

I have the same question (0)
  • Smartus Profile Picture
    620 on at

    Hello everyone

    Someone already found a solution ? I didn't but I'll try further to find the solution.

    Thanks in advance.

    Vincent

  • Verified answer
    Rachit Profile Picture
    4,015 User Group Leader on at

    Hi Vincent,

    I could see a common mistake in all the three code examples you mentioned.

    You are trying to run the while loop and also update the record using the same table object.

    Use different objects of the table for looping and for updating the records.

    Thanks,

    Rachit Garg

  • Smartus Profile Picture
    620 on at

    Hi Rachit

    Thanks for the answer, that was indeed the problem which I found out by myself just 5 minutes ago. I got your answer through mail while I was typing here that it was the problem.

    I didn't know that it would cause a problem and as I said I'm learning still.

    So thanks for the solution.

    Kind regards,

    Vincent

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