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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Saving Form Header triggers firstly saving Lines

(0) ShareShare
ReportReport
Posted on by 15

I have a big problem, like in the title "Saving Form Header triggers firstly saving Lines", but let me explain...

I'm creating new record in SalesQuotationTable and fill it with one line. Values is not importatant, everything can be random untill it validate correct.

So here comes my problem:
(Everything happen on Lines View)

1. I change "Product Name" string (or any value) on added line. (That is the most importat step)
2. I click on Header. (Line write triggers, and saves the line)
3. I change any value on Header (I choose a value that is visible on Lines Details, so for example "Adress" or "Delivery date")
4. I click Ctrl+S.

And here is my problem, because after step 4. the Line write triggers first (Not header), the code saves lines and header values, and after this the header write method triggers and starts looking for any typed changes (xRecord.Field != xRecord.orig().Field). He find nothing, because the line's write method updated the Orig a second ago.

What I discoveded is that after changing something on line and next on the Header, then Ctrl+S triggers leaveRecord method, and the super method calls ValidateWrite/Write on the lines.
When I change only Header valuses and click Ctrl+S, then leaveRecord calls ValidateWrite/Write on Table(Header) first.

Anyone can have any idea what happens, and why Lines are updated before header that updates the header? 

PS I know this explanation can be complicated, so ask me everything. I lost 2 days on this issue 

I have the same question (0)
  • Suggested answer
    ArnoldVW Profile Picture
    on at

    Hello Lukasz,

    System updates Coverage status for Master planning (QuotationTable.CovStatus) whenever a date on the line is updated. This will make sure Master planning will reconsider this quotation again when updating net requirements, because the requirement date is changed. Code responsible for this is in SalesQuotationTableLineType::update: 

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

    public void update(boolean _dropInvent = false,
    Common _childBuffer = null,
    boolean _updateOrderLineOfDeliverySchedule = true)
    {
    InventUpd_Estimated estimated;

    ttsbegin;

    salesQuotationLine.setQuotationStatus();

    salesQuotationLine.ConfirmedDlv = salesQuotationLine.ShippingDateRequested;
    this.updateSalesQuotationTable();

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

    SalesQuotationLineType::updateSalesQuotationTable runs:

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

    void updateSalesQuotationTable()
    {
    SalesQuotationTable salesQuotationTable;

    salesQuotationTable = salesQuotationLine.salesQuotationTable(update);

    salesQuotationTable.CovStatus = 0;

    salesQuotationTable.write();
    }

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

    This ALWAYS updates Quotation table.

    In D365FO this behavior was changed with update https://fix.lcs.dynamics.com/Issue/Details?kb=4602931&bugId=518567. This made sure the quotation table was only updated when CovStatus field is not yet set to value <> 0. and additionally checks if any quotation line fields have been updated. This will reduce the number of times the Quotation table gets updated. This update is not available for AX 2012 however. 

    I hope this helps understand why you see Quotation header getting updated first.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans