Hello everyone,
I have a custom attachment table that I created as per our requirement as below:
As you see above, I have created a polymorphic lookup column called "Regarding" using the XrmToolBox Polymorphic Lookup Creator that has the below-referenced table(s):
After this column was created successfully from the tool, it created the relationship between the attachment table and employee certification as below:
The relation between those two tables is many attachments can be linked to one employment contract which means I can attach multiple files for one contract.
After setting up all the relationships between those two tables, I navigated to the employment contract table to add the sub-grid of the attachments.
The problem that I am facing is the below:
Whenever I add the sub-grid into the employment contact table and I check "Show related record" the attachment table disappears from the dropdown knowing that it should appear in the show related record dropdown because the user should only see the multi-attachments files that are related to the employment contract.
If I uncheck the show-related record the attachment table is being displayed, however, it shows all the records that are not related to this contract which is wrong and it shouldn't be like this.
The main requirement is to display the attachments that are related to the record it belongs to and the aim of this requirement is to have a parent table called "Attachment" that will be linked to another 10 tables that require attachments and this requirement is very similar to the behavior of the Activities Note table that is related to many tables in any CRM module. (In our requirement, we don't want to use Note entity, or SharePoint integration)
It seems that the polymorphic column or the relationship between the tables is wrong.
What will be the solution and the relationship type between these tables to make it work as expected? Could you please provide an example and explain it in detail?
Any help is highly appreciated.
Best regards,
EBMRay