User interface - Mapping many to many relationship

Hi,

We have a requirement for a Form in terms of multiple materials (Items) can have multiple attachments.  Further elaborating this, on the line level, there would be a table where users are able to add multiple items.  For the same added item, there would be a link where once clicked, it will open another table referencing the same item - where users can upload multiple attachments.

Does anyone have a sample whereby for 1 item, tag all uploaded attachments to that item.  I am thinking this would involve nested CDT.  Some suggestion would be great. Thanks

  Discussion posts and replies are publicly visible

  • Hi Jonathan,
    As per my understanding, you want to add multiple items in some table and for every item their can be multiple attachments.
    to do so you will create the data store and all the mapping to verify the table and on click of add item will directly save the item to the DB.
    you can use a!writeToDataStoreEntity() and after that item is updated in table you can have its id also(that is the primary key that you have created to be incremented automatically), Also don't forgot to create another table to store attachment details. create one cdt as {itemId,documentId,documentName} and append it to your ri variable of the type of attachment CDT.
    After you submit the form the attachments will get saved and the attachment table will be updated.
    let me know if that worked for you.

    Thanks
    Shivam
  • Nested CDTs are better avoided. You may create different tables with Foreign Key constraints. In the first table you can have a column with link. On click , you may show a dynamic section below the table relevant to this row . In this section you can add multiple files or data. To manage the mapping , you can have a temporary keys hidden from the user.