Hi I have a ReviewDocuments CDT which contains two multi value child CDTs.

Hi
I have a ReviewDocuments CDT which contains two multi value child CDTs.
I have a documents array containing 2 documents and a CDT FieldworkAnalyticalReview array with 3 sets of details.
Each FieldworkAnalyticalReview needs to be associated with each of the documents
i.e.
Documents: {A,B}
FieldworkAnalyticalReviews: {1,2,3}
Which needs to become :
1.          ReviewDocuments CDT ID=1 with 1A
2.          ReviewDocuments CDT ID=2 with 1B
3.          ReviewDocuments CDT ID=3 with 2A
4.          ReviewDocuments CDT ID=4 with 2B
5.          ReviewDocuments CDT ID=5 with 3A
6.          ReviewDocuments CDT ID=6 with 3B

What would be the best way to achieve this.
Thanks


OriginalPostID-193229

OriginalPostID-193229

  Discussion posts and replies are publicly visible

Parents
  • Use a join table between FieldWorkAnalyticalReview and Documents. This may be called FieldWorkAnalyticalReview_Document. There will be at least 3 fields - add other metadata fields as you like. The ID (primary key) of this type, the foreign key ID of the Document, and the foreign key ID of FieldWorkAnalyticalReview. I would probably recommend not nesting the types - as in the screenshot. Your queries may return more data than you need. You could just soft-link by ID.
Reply
  • Use a join table between FieldWorkAnalyticalReview and Documents. This may be called FieldWorkAnalyticalReview_Document. There will be at least 3 fields - add other metadata fields as you like. The ID (primary key) of this type, the foreign key ID of the Document, and the foreign key ID of FieldWorkAnalyticalReview. I would probably recommend not nesting the types - as in the screenshot. Your queries may return more data than you need. You could just soft-link by ID.
Children
No Data