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 :
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

I have the same question (0)
  • Suggested answer
    CDsilva Profile Picture
    4,188 on at

    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

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

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

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    Hello Raphael,

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

    you've tried?

    Best regards

  • Community Member Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans