Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

"An attempt was made to change an old version of a Sales Line record" after changing Quantity

(0) ShareShare
ReportReport
Posted on by

Hello community

I did a test migration from NAV 2015 to 2018 CU5 (CH-version).

It seems to work fine, but when I add a new line in a new order or a new quote, it is not possible to change the quantity or the unit price directly.

I get the following message:
"An attempt was made to change an old version of a Sales Line record. The record should be reread from the database. This is a programming error.Identification fields and values:Document Type='Quote',Document No.='VA112244',Line No.='10000'"

After a refresh, I can enter the correct value normally. 

I debugged the session and could find the following problem code (debugger stops at red marker):

Page 95: Sales Quote Subform

QuantityOnAfterValidate()

  IF Reserve = Reserve::Always THEN BEGIN
    CurrPage.SAVERECORD;
    AutoReserve;
  END;
  
  IF (Type = Type::Item) AND
     (Quantity <> xRec.Quantity)
  THEN
    CurrPage.UPDATE(TRUE);

Any ideas why this is happening? I did not change this code so it seems to be default.

Thank you.

Best regards

Raphael

*This post is locked for comments

  • Suggested answer
    RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    We also had this issue when upgrading to dynamics nav 18.

    we managed to track down the issue,  it was related to the "Calc. Inv. Discount"  in the "sales & recievables Setup" . On our data we upgrade in the sale setup this was ticked on, which in turn  gave the error you referring to. when checking on the cronus data this option is switch off by default. hence why this issue doesn't appear in cronus data.

    Out of interest if this is switch on for cronus you get the same error.

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Tested Raphael,

    Error also in the C03 and CU06, my process is to install by default NAV, new empty company, import default package, and with rapid shared import customers, products, suppliers.

    Something in that process makes it fail, if in cronus it works it is my method that fails. It is the first time that happens to me and there are many NAVs implanted ..

    With the CU03 has not already given you problems?

    What process do you use exactly?

    Greetings, thank you.

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hi again

    Well, I do not know that. Maybe it is a combination of my code and default code.

    Maybe you can test it on your system.

    Best regards

    Raphael

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hello Raphael,

    If you think it is a CU05 error, why does not it fail in the cronus?

    you've tried?

    Best regards

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hi Alsampa

    I just found that the problem is not our code, it is CU05!

    I tried a new test migration to CU03 (only code, not platform and client), which we had tested before updating to CU05, this morning and the problem does not appear in CU03.

    So maybe it is fixed in CU06 but I could not find a hint in the release notes.

    I think we will do the tests in CU03 and will upgrade to a new CU in the future.

    Please let me know, if this is also working for you.

    Best regards

    Raphael

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Stefano Demiliani responded on 4 Jun 2018 9:28 PM

    The problem is explained here: community.dynamics.com/.../saverecord-and-update

    --

    Hello, here there is an explanation to a programming error that produces the message, in these cases there is no programming, all the objects are the standard ones recently installed the product, thanks

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hi,

    I have the same problem, new installation of 2018 cu05, new company, importing data with rapid. in cronus it does not happen, I have not modified anything of code, standard 100%, if I give or you give with tracks we tell ourselves.

  • RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hello

    Thank you for the suggestions.

    That means I have to dig down to find the problem? It was not a problem in NAV 2015, it just occured after the upgrade to NAV 2018 CU05.

    I thought about to comment out the "CurrPage.UPDATE(TRUE);", but I am not sure which impact this would have.

    Thank you.

    BR Raphael

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    The problem is explained here: community.dynamics.com/.../saverecord-and-update

  • Suggested answer
    CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: "An attempt was made to change an old version of a Sales Line record" after changing Quantity

    Hi,

    It looks like there is more than one trigger modifying the same field or record

    refer this link community.dynamics.com/.../error-an-attempt-was-made-to-change-an-old-version-of-a-sales-line-record

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans