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)

Always add/create a new row at the bottom of grid (AX7)

(0) ShareShare
ReportReport
Posted on by

Hello, Experts.

I made a "New" button at a top of grid in form (AX7)

When the "New" button is clicked, I would like to add/create a new row ati the bottom of grid independent on current focus completely.

So I tried this code below:

------------------------------------

   [DataSource]
    class DummyTable
    {

        public void create(boolean _append = true)
        {
                this.last();
                super(_append);

        }

    }

------------------------------------

(DummyTable is a datasource in form.)

Definitely, when I clicked "New" button once, this code made a new row add in the bottom of grid.

But, when I clicked "New" button again, a new row added in the second of grid.

And when I clicked "New" button again, a new row added in the bottom of grid.

And when I clicked "New" button again, a new row added in the second of grid..............

All I would like to do is a new row always adds/creates in the bottom of grid.

Could you give me any ideas?

Best wishes,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    What about removing all the code and setting Insert At End property (of the datasource) to Yes?

  • O.Naga Profile Picture
    on at

    I apologize for the replying late.

    I understood the cause.

    The reason why it could not be added to the last line was that when the last() execute, this focus movement caused data committing and the focus position is reset.

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