Skip to Content
author's profile photo Former Member
Former Member

Adding an entity to an entity set

Hi,

I am creating an iOS app using the offline store.

Following the following blog I was able to create hierarchal data for the offline store. Creating hierarchical data using Content-ID Ref... | SCN

However I am having issues updating entity sets of an entity.

I have an existing Parent (Person) entity that has a navigation property linking an entity set of multiple email addresses. When I try to add an additional email address to the existing email address entity set I receive an error stating deep inserts are not supported.

Any help will be much appreciated.

Jeff

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 13, 2016 at 10:34 AM

    Hi

    I followed your instructions in your blog to use batch requests with content ID as a workaround for offline store deep insert.

    I created an entity structure of:

    person: {

    guid: xxxxxxxxxxxxx,

    name: John Smith,

    emails: [

    {

    email: {

    personGUID: xxxxxxxxxxxx

    address: abcd@domain.com

    }

    },

    {

    email: {

    personGUID: xxxxxxxxxxxx

    address: abcd1234@domain.com

    }

    }

    ]

    }

    The 1:N relationship of Person to Emails was achieved using the batch request. As you can see I can query all the emails associated to a Person by using a query in the Emails collection of Emails(PersonGUID:'xxxxxxxxxxxx').

    At the moment this is all local and have not been flushed to the server.

    If I create add another email entity to Emails collection assigning personGUID with the value of the person created in the batch request. I find that if I query using Emails(PersonGUID:'xxxxxxxxxxxx'), I will only see the two emails created during the batch request and not the stand alone email I created after the change set was closed.

    I did a check and the third email I created is in the offline store as when I query to return all emails in the Emails collection the third email is in fact there marked with a local annotation.

    Do you know why this is happening?

    Thanks!

    Jeff

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.