Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Polymorphic lookup - Sub-Grid attachments is not working to show the related records

(0) ShareShare
ReportReport
Posted on by 873

Hello everyone,

I have a custom attachment table that I created as per our requirement as below:
AttachmentTable.png
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):
XRMLookup.png
After this column was created successfully from the tool, it created the relationship between the attachment table and employee certification as below:
RelationCreatedbyXRMs.pngEmploymentContract-Relation.png
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.
ShowRelatedHidden.png
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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans