Error An Item was made to change an old version of a Item record

Question Status

Suggested Answer
Tina Menezes asked a question on 21 Apr 2017 5:43 AM

Hi all,

I have written code to automatically post the Item journal lines after it is created. The journal lines are successfully posted but I get an error that 'An Item was made to change an old version of a Item record. The record should first be reread from the database. This is a programming error. Identification fields and values:..'

Can someone suggest how should this be solved?

Reply
Suggested Answer
Binesh Singh Rajput responded on 21 Apr 2017 5:52 AM

Hello Tina,

Use COMMIT function. so before fetching it saved in DB, and also after posting you have to call so it saved the current record.

It mostly came, when the record moved/deleted in background and, in front-end, still user open this record.

Reply
Tina Menezes responded on 21 Apr 2017 6:15 AM

Hi Binesh,

I used Commit. I still get the error. Can you please elaborate?

Reply
Binesh Singh Rajput responded on 21 Apr 2017 8:03 AM

Hello Tina,

Could you share your code, so we can check.

Reply
Suggested Answer
Suresh Kulla responded on 21 Apr 2017 9:43 AM

Tina,

Are you making any changes to the Item record during posting, you need to use a GET statement.

Reply
Tina Menezes responded on 21 Apr 2017 10:08 AM

Hi Suresh,

I am using setrange and findfirst and then posting the record.

Reply
Suggested Answer
Suresh Kulla responded on 21 Apr 2017 11:31 AM

Please send us the code

Reply
Tina Menezes responded on 23 Apr 2017 11:37 PM

I have written code to insert data into the item journal and after that to post the inserted data.

Reply
Suggested Answer
Binesh Singh Rajput responded on 21 Apr 2017 5:52 AM

Hello Tina,

Use COMMIT function. so before fetching it saved in DB, and also after posting you have to call so it saved the current record.

It mostly came, when the record moved/deleted in background and, in front-end, still user open this record.

Reply
Suggested Answer
Suresh Kulla responded on 21 Apr 2017 9:43 AM

Tina,

Are you making any changes to the Item record during posting, you need to use a GET statement.

Reply
Suggested Answer
Suresh Kulla responded on 21 Apr 2017 11:31 AM

Please send us the code

Reply