To create attachments in ArcCatalog, right click the FC in ArcCatalog>>Manage>>Create attachments. It creates the [parent name]_ATTACH table and [parent name]_ATTACHREL relationship. The graphic shows attachment tables/relationships created for tables.
By default, the _ATTACH table contains the following fields where the REL_GLOBALID field is used to relate to the parent GlobalID:
One way I tried was to create relationship classes between each FC and the one _ATTACH table that I had ArcCatalog create for FC0 so:
- FC1:FC0_ATTACH using parent GlobalID from FC1 to FC0_ATTACH REL_GLOBALID
- FC2:FC0_ATTACH using parent GlobalID from FC2 to FC0_ATTACH REL_GLOBALID
- and so on for the other FCs
That didn't work in the sense that the table would show up in ArcMap, ArcGIS Online, and Collector for ArcGIS but I couldn't add any attachments except for FC0.
Another way I tried was to add GUID fields to the FC0_ATTACH table for every FC I wanted to relate, which sounds like what you suggested earlier.
- FC1:FC0_ATTACH using parent GlobalID from FC1 to FC0_ATTACH FC1_GlobalID
- FC2:FC0_ATTACH using parent GlobalID from FC2 to FC0_ATTACH FC2_GlobalID
- and so on
That approach yielded the same results as the first approach.
To add to the confusion of how ESRI handles attachments. I used ArcCatalog to auto create attachments for an Assessment FC, which gave me:
- Assessment FC
- Assessment_ATTACH table
- Assessment_ATTACHREL relationship
I looked at the Relates property for Assessment FC in ArcMap and could not see the _ATTACHREL relationship listed; however, I could still add attachments. The relationship shown in the graphic below is for another table and not for the Attachment table.
Then I manually created a relationship between a Camera FC (in the same FGDB as Assessment) to the Assessment_ATTACH table using parent GlobalID to child REL_GLOBALID. Since the Assessment_ATTACH relationship works for Assessment FC, I thought I could hitch the Camera FC to the same attachment table and inherit all the attachment capabilities afforded the Assessment FC. Wrong! I could still add attachments for the Assessment FC, but not for the Camera FC. I look at the relate properties for the Camera FC and the relationship I created between Camera FC:Assessment_ATTACH is in the list.
It makes me wonder if there is something going on behind the scenes to make the attachment relationships work that isn't exposed to the user. Also wonder if a personal GDB would treat attachments differently seeing as how it follows the Access database schema. A rabbit hole for another day. For now, I'll do it the ESRI way and create attachments for every FC/table that needs it.
Thanks.