ruby_odata icon indicating copy to clipboard operation
ruby_odata copied to clipboard

MS Dynamics NAV: Updating data

Open KDGundermann opened this issue 8 years ago • 0 comments

When updating an object in MS Dynamics NAV you will receive an error message:

    HTTP/1.1 400 Bad request
    <m:message xml:lang="en-US">
        An error occurred while processing this request.
    </m:message>

ruby_odata inserts an __metadata attribute in the class:

    # Fill metadata 
    meta_id = entry.xpath("./atom:id", @ds_namespaces)[0].content 
    klass.send :__metadata=, { :uri => meta_id } 

When updating the object, this __metadata will be included in the JSON document, but the NAV server does not accept this unknown value.

KDGundermann avatar Oct 09 '17 14:10 KDGundermann