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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Inserting the record at the end of the grid

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have a grid on a form and when I press CTRL+N,I want the record to be inserted at the end of the grid but it goes back to the first record and insert the new record at the second position.

Then I wrote datasource_ds.last(); in create method of the datasource,so now when I press CTRL+N ,it inserts the record at the end of the grid first and then again if I press CTRL+N ,it inserts at the second row.

Hence first it inserts at end and then it inserts at second row position.

I am not sure how to fix this.

Also,insertatend property is yes.

*This post is locked for comments

  • Suggested answer
    BrandonSA Profile Picture
    1,677 on at

    Hi Roshni

    On the datasource that your grid uses, there is a property called StartPosition. Change it to 'Last'.

    That means that all of the newest records will appear at the bottom, and the oldest ones at the top.

    You don't need any code for this requirement.

    Hope this helps

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    Actually there's a property called InsertAtEnd in the data source. Set that to yes.

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Roshni,

    1.Data source InsertAtEnd property. You have already mentioned that you are Yes.
    2.When you currently add a new record, move the selected row of the cursor and add it again. Does the adding order change?

    I simply created a form and added data sources.

    My solution:
    Override the create() method in your datasource.

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


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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Prashant Singh Profile Picture

Prashant Singh 2

#1
nmaenpaa Profile Picture

nmaenpaa 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans