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

kimhaak
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
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
0
Answers
-
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.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions