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)

Prevent Updating All SalesLine When Modifying SalesTable Field.

(0) ShareShare
ReportReport
Posted on by 1,214

Hi,

I'm working with ShippingDateConfirmed (Confirmed Ship Date) field in SalesTable & SalesLine Table in SalesTable form.

In standard functionality, when Confirmed Ship Date in Sales Order Header is modified and SalesTable.write() method is called, a dialog prompt will appear asking to update the Confirmed Ship Date in all related lines.

updateorderline.png

If yes is selected, the Confirmed Ship Date value will be copied to all lines.

Our client requested to allow only line(s) which is fully reserved to update the Confirmed Ship Date, otherwise set the value to null.

Can we actually achieve this? 

In SalesTable.write() method I noticed SalesTable2LineUpdatePrompt instance is being used so I'm searching around these SalesTable2LineUpdate, SalesTable2LineUpdatePrompt classes but cannot find a suitable place to implement the logic.

I found this article but obviously I'm not going to overlayer these classes so I'm still looking for another way.

Please share your suggestions.

Thank You.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    HAIRUL HAZRI Profile Picture
    1,214 on at

    Subscribing to SalesTable2LineUpdate_Post_update solves this issue. 

    Note that since this is post update method, what I did was not preventing the update, but re-update the value. 

    [PostHandlerFor(classStr(SalesTable2LineUpdate), methodStr(SalesTable2LineUpdate, update))]
        public static void SalesTable2LineUpdate_Post_update(XppPrePostArgs args)
        {
            SalesTable2LineUpdate thisBuffer = args.getThis();
            QueryRun                queryRun;
            SalesLine               salesLine;
    
            queryRun = thisBuffer.queryRunLine();
            
    
            while (queryRun.next())
            {
                if (queryRun.changed(tableNum(SalesLine)))
                {
                    salesLine = queryRun.get(tableNum(SalesLine));
                    
                    if(condition)
                    {
                        ttsbegin;
                        salesLine.selectForUpdate(true);
                        salesLine.ShippingDateConfirmed = dateNull();
                        salesLine.doUpdate();
                        ttscommit;
                    }
                }
            }
        }



    Cheers.

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
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans