Breeze + OData + MS Dynamics CRM

454 Views Asked by At

I'm trying to use Breeze 1.4.0 with OData for managing data operations against a MS Dynamics CRM 2011 OData service.

Retrieving data works fine, but trying to push data doesn't work. I tried to do a very simple update, but Breeze fails when it reaches the second line:

function updateDeleteMergeRequest(request, aspect, prefix) {
        var extraMetadata = aspect.extraMetadata;
        var uri = extraMetadata.uri;
        if (__stringStartsWith(uri, prefix)) {
            uri = uri.substring(prefix.length);
        }
        request.requestUri = uri;
        if (extraMetadata.etag) {
            request.headers["If-Match"] = extraMetadata.etag;
        }
    }

I have debugged through it, and it fails because aspect.extraMetadata is undefined. aspect is a Breeze Entity.EntityAspect object, which doesn't have that property.

I have also found that the DataServiceVersion used by Breeze for OData is 2.0, while the one for the OData service at MS Dynamics CRM 2011 is 1.0. I'm not sure if that has something to with it. I have also tried to change the DataServiceVersion for Breeze to 1.0.

Any ideas?

Thank you very much.

0

There are 0 best solutions below