Web service sales order UPDATE method - field validation headache
                
                    kimhaak                
                
                    Member Posts: 2                
            
                        
            
                    Hi
Trying to update a field in a blanket order sales line, via web-service.
To set field "A", i must have set field "B". This is the behaviour (custom) in Navision.
Problem is that when i send the UPDATE call via SOAP, it sets A and B at the same time, causing NAV to send a error message. If i set just B, it is okay. If i set A just after, the key is used and i get a error stating someone else has modified the order.
I do not want to read the entire order again, to issue another UPDATE to field A. Do i really need to?
Also, to identify the specific sales line, i use its key. Is it another value i could/should use instead, who could predict somehow? Saves some read/iteration, i could just read the initial sales order header key and figure out number of linesm and then calculate the id of the line i want to change, or something like that.
Thanks
Kim
                Trying to update a field in a blanket order sales line, via web-service.
To set field "A", i must have set field "B". This is the behaviour (custom) in Navision.
Problem is that when i send the UPDATE call via SOAP, it sets A and B at the same time, causing NAV to send a error message. If i set just B, it is okay. If i set A just after, the key is used and i get a error stating someone else has modified the order.
I do not want to read the entire order again, to issue another UPDATE to field A. Do i really need to?
Also, to identify the specific sales line, i use its key. Is it another value i could/should use instead, who could predict somehow? Saves some read/iteration, i could just read the initial sales order header key and figure out number of linesm and then calculate the id of the line i want to change, or something like that.
Thanks
Kim
0                
            Answers
- 
            I recently did an assessment to see if I should use SOAP or OData in my project.
I found OData to be faster and giving more choices if you only use standard page/report/query services.
I picked Odata for my use case, and there is no need to specify a KEY if you UPDATE a record. Sure it makes sense to do so if you update a record that might be updated by someone else...
So with ODATA, if you send HTTP Header:
If-Match: *
.. instead of a key which looks something like ...
If-Match: W/"'24%3BlQEAAACN1ZNxAAAAAAAAAA%3D%3D9%3B1147927720%3B'"
..then the KEY is not checked and the call succeeds.
Same for DELETE ops.
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
 - 323 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