oData "joins" (2)

Hi all,

2 days ago I posted asking for odata query with relationship: https://community.bpmonline.com/questions/odata-joins

I solved this issue and I posted a solution for that.

I come back because I made working querys with 1/1 relationship but not 1/n for example the idea is to get all the contacts for a particular account:

https://URL/0/ServiceModel/EntityDataService.svc/AccountCollection(guid…

I get the attached error.

Do i have an error with the relationship names? It's possible to do in bpm'online ?

Kind regards

File attachments
Like 0

Like

3 comments

Dear Uriel,

You can achieve such task by referring to the contact collection, filtering the results by Account Id. 

The request line should look like this:

// GET <BPMonline application address>/0/ServiceModel/EntityDataService.svc/ContactCollection?$filter=AccountId eq guid'00000000-0000-0000-0000-000000000000'

You can find more filter usage here:

https://academy.bpmonline.com/documents/technic-sdk/7-8/working-bpmonli…

Also, in case you use $expand in your requests, please, take into account, that in this case OData is limited to not more than13 objects to return (see info box).

https://msdn.microsoft.com/en-us/library/gg309461(v=crm.7).aspx#BKMK_ex…

Regards,

Anastasia

Anastasia, how are you?

thanks for the comment.

We need something different. The query would be from 1 to N, for example from an account bring all contacts as a collection and for each contact for example bring us all the addresses.

Thinking of an XML response we should have something like this:

 



<?xml version="1.0" encoding="UTF-8"?>

<Response>

       <Account>

              <Name>Coca Cola</Name>

              <Contacts>

                     <Contact>

                            <Name>john</Name>

                            <Addresses>

                                   <Address>234 street</Address>

                   <Address>2234 street</Address>

                               </Addresses>

                        </Contact>

                     <Contact>

                            <Name>Peter</Name>

                <Addresses>

                                   <Address>234 street</Address>

                               </Addresses>

                        </Contact>

                     <Contact>

                            <Name>Caroline</Name>

                        </Contact>

                 </Contacts>

          </Account>

   </Response>



thank you very much.

Kind regards

Uriel,

Unfortunately, possibility to expand collection is not yet implemented in the system. However, please feel free to use the above mentioned approach, as a workaround. 

Regards, 

Anastasia

Show all comments