Options

Web service sales order UPDATE method - field validation headache

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

Answers

  • Options
    vmantavmanta Member Posts: 16
    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.


Sign In or Register to comment.