Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Master-Details example #292

@darianferrer

Description

@darianferrer

Hi,

I've a view where there is a form (category entity) and a list with inline edition (service entity). In my model, I define that Category has a collection of Service and also Service has a navigation property to Category. What I'm trying is to add the new category with its collection of service. The odata config is set with enableDeepSave = false and withReferenceMethods = true.

If I create a new category with one service, the batch request looks like this:

POST http://localhost:20300/odata/ProductServiceTypes HTTP/1.1
Content-ID: 1
Accept: application/json;q=0.9, /;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0

{"id":0,"createdById":0,"modifiedById":0,"dynamicProperties":{"displayName":{"en":"T"}}}
--changeset_b91b-bbbe-e01c
Content-Type: application/http
Content-Transfer-Encoding: binary

POST http://localhost:20300/odata/ProductCategories HTTP/1.1
Content-ID: 2
Accept: application/json;q=0.9, /;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0

{"id":0,"productType":"General","canHaveSupplementsOrDiscounts":true,"canHaveContracts":true,"createdById":0,"modifiedById":0,"dynamicProperties":{"displayName":{"en":"T"}}}
--changeset_b91b-bbbe-e01c
Content-Type: application/http
Content-Transfer-Encoding: binary

POST $2/services/$ref HTTP/1.1
If-Match: *
Content-ID: 3
Accept: application/json;q=0.9, /;q=0.1
OData-Version: 4.0
Content-Type: application/json
OData-MaxVersion: 4.0

{}

You can see one post for each entity and the last one would be the association between the two entities, but its body is empty. Debugging the oDataProvider.js, it seems that with a collection it cannot set the @odata.id property. Is there a way to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions