Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

An attempt was made to change an old version of a transfer header record in dynamics nav 2015

Posted on by

Hello Everyone,

I add two fields in Posted Transfer Shipment table Total Quantity and amount by using calcfield on Transfer Shipment Line table. To calculate amount against each item i use code and insert in Amount Field and modify that field. It work fine but is that when i create new transfer order it display an error message "An attempt was made to change an old version of a transfer header record. The record should be reread from the database."

This code i use to modify amount field.

TransShpLine.RESET;
TransShpLine.SETAUTOCALCFIELDS(TransShpLine.ItemAmount);
TransShpLine.SETRANGE(TransShpLine.Calculated,FALSE);

IF TransShpLine.FINDSET THEN REPEAT
TransShpLine."Document No." := TransShpLine."Document No.";
TransShpLine."Line No." := TransShpLine."Line No.";
TransShpLine.Amount := (TransShpLine.Quantity * TransShpLine.ItemAmount);
TransShpLine.Calculated := TRUE;
TransShpLine.MODIFY;
UNTIL TransShpLine.NEXT = 0;
MESSAGE('Done');

*This post is locked for comments

  • 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 transfer header record in dynamics nav 2015

    Why in the FINDSET loop you re-assign Document No and Line No with the same values?

    You can remove these lines:

    TransShpLine."Document No." := TransShpLine."Document No.";

    TransShpLine."Line No." := TransShpLine."Line No.";

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: An attempt was made to change an old version of a transfer header record in dynamics nav 2015

    Could you post the code which modifies the Transfer Header.

  • Mubasher Profile Picture
    Mubasher on at
    RE: An attempt was made to change an old version of a transfer header record in dynamics nav 2015

    Transfer header

  • Hannes Holst Profile Picture
    Hannes Holst 5,767 on at
    RE: An attempt was made to change an old version of a transfer header record in dynamics nav 2015

    Does the error say "Transfer Header" or "Transfer Line"?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans