Adding sales line - "Another user has modified the record for this sales header after you retreived

kimhaakkimhaak Member Posts: 2
Hi



I am at best a beginner in this, but i am making a simple webpage that interacts with Navision. Using PHP and SOAP, and most of it is working. I do this on NAV 2016



However, i have a strange issue.

I am updating a blanket sales order line, or more correct, creating it. The order itself always exists, i am just adding a new line by a update method.

To do this, i read the key for the ordercard, a really long one, containing all keys for both the header and the sales lines.

Then i use this key, and do an update against the order, and 50% of the time add a sales line successfully.

The other time, i get the message "Another user has modified the record for this sales header after you retreived it from the database". This can happen, so if i do the routine again, it should get a new key, and be ok. However, i never get a new key...

The only way to get it working again for the particular order, is to go into Navision, open the blanket order and press refresh. Then it will work.



My code is working, but it looks to me NAV either is not giving out a new code for each "READ" i do, or i need to do something to actually get a new key .



Any ideas would be greatly appreciated.



--

Kim

Answers

  • RockWithNAVRockWithNAV Member Posts: 1,139
    Hey kimhaak ,

    This is some kind of error which do comes If it sometimes getting locked with 1 2 concurrent calls, sometimes too it stores the old error in the cache. Try calling the Function first from internal NAV with same Params from which you are getting the Error. If you too got the same Issue then check which piece of code is giving that error. The First thing you should do is you should add CLEARLASTERROR in the beginning of the NAV code and then try once.
Sign In or Register to comment.