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)

Force Update of Form Sales Lines Modified through Code

(0) ShareShare
ReportReport
Posted on by

Our users have asked for a custom line number field for Sales Lines. They want a simple integer that would be renumbered whenever new lines are inserted or existing lines are deleted.

I have written code that renumbers lines on the SalesTable form whenever new lines are inserted and deleted. However, only the last line selected gets updated in the database when the user closes the form or steps off the line. Is there any way to force an update on all of the lines when they get renumbered?

Right now, I am doing this with an update event on the SalesLine table, and that works with some minor screen flickering on the SalesLine grid. However, since this is an event on the SalesLine table itself, it will result in a significant performance hit whenever sales lines are bulk loaded.

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    There are classes such as SalesLineType >> insert/update methods

    Put your logic there before or after super [ .doinsert() ] depending upon requirement.  While a line is inserted, you can get the total number of lines with same SalesId where Line.Recid != thisLine.RecId and finally add +1 to it, to get next counter.

    However, as you also setting numbers free on deletion of the line, by renumbering all existing lines of that sales Order, this mayn't be great thing for performance.

    I would be more interested to know business requirement in such cases, rather than to think about code.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans