cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an entity to an entity set

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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