I have a ‘main’ document represented with form which contains an embedded view. This view displays ‘child’ documents (where ‘main’ is parrent). The relationship is formed with $REF filed (response document). This works fine.
Is there a way, how can I link the response document (it doesn’t have to be a response document) to multiple parrent documents?
I tried to look this here on forum, but no success.
Subject: Is there a way, how can I link 1 child document to multiple parrents?
You can create a field on your ‘response’ document which contains a list of keys to the ‘parents’.
For example, it is normal to have company documents with contact / person documents which are children to the company.
In some circumstances, you might want to say a person also works at several other companies (think consultants, or specialist doctors who work at multple clinics, etc). If you create a list of ‘other companies’ on your person document, then you can create a view categorised by this field and use it as your key for your embedded view.
HTH
Subject: RE: Is there a way, how can I link 1 child document to multiple parrents?
Hi Michelle,
I’ll test your proposal as soon as possible. However, I though, you can’t put a key for embedded view using multivalue field, can you?
Subject: RE: Is there a way, how can I link 1 child document to multiple parrents?
No - you can only put a single key for the embedded view.
The trick is to categorize that embedded view in such a way as you get the documents you want in a given category.
Using my example, if I add 3 companies in a field calls ‘Also works at’ on my contact document, then categorize by ‘Also works at’, my contact appears in the view three times. On my Company form, the embedded view would use ‘Company Name’ as the key field, and would then list all the contacts who have this company listed under ‘also works at’.
If you want to go the other way - for example have an embedded view on the contact document which lists all those companies that a person works at, then you need to add a field to the company document when you link the two (something like ‘Associated Contacts’ with either the name or some other unique ID for the contact)
If this doesn’t make sense, describe your actual scenario and I will try and re-phrase it in your context.
Subject: RE: Is there a way, how can I link 1 child document to multiple parrents?
Michelle,
thanks a lot for your help. I have managed to solve my problem !!
Thx again a lot.
Juraj