Can anyone please provide me C# code to update sales order through web service.
I have tried same but getting error “Document Sales order could not be updated. Error details: The document hash does not match the hash in the XML. The document may have been changed since last read”.
It seems that you already know how to call update, but you’re sending invalid data or the document has really changed meanwhile. Have you obtained the document by the read operation?
I have obtained the document by read operation. But , it is giving document hash error at the time of updation.
Is there a way to get the current hash code ,so that updation can be made successfully…
Do you have any piece of code in which u have updated some records in sales line? AS i have checked several ways to perform it but not able to figure out…
It don’t see the point in spending time writing such code - it wouldn’t show anything more than “get a document from the read operation … change a property … call the update operation”. If you want to discuss a specific code, show us your code.
Regarding the hash, it’s somewhere in the document header. You can, for example, look at message’s XML or check out AxdBaseRecordInfo.getRecordHash() in debugger (I believe that the hash is calculated there).
But when i am executing code it is giving me error:
Document Sales order could not be updated. Error details: The document hash does not match the hash in the XML. The document may have been changed since last read
The code works fine. I only changed SalesId and removed the reference to company (since I didn’t need it).
I can reproduce your problem only by simulating an update conflict. I interrupt the application after reading the order, change the line in AX and continue with execution of the application. That’s likely what happens in your case too. Note that records may be changed by code as well as users.
Hello Martin, I hope you’re well. I want to know if they could already provide a solution to this problem, I would appreciate it very much. I have this same problem, and I’m in a development environment, where there is no competition, I’m the one I’m manipulating the document and do not understand why I throw this error. I debug my code in C #, and the FaultException throws me “Thedocument hash does not match the hash in the XML. The document May Have Been changed since last read**.**”