Typically you would setup D365/CDS to SharePoint Document libraries integration using the OOTB integration service. It is documented here. https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/administering-dynamics-365/dn531...)
This sets up the relationship between your custom entity and the Document Location entity correctly.
Sorry for the late reply. Here is the correct link.
Check out these cool Power Apps & vote on your favorite!
Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)
Check out whats happening in Power Apps
FIll out a quick form to claim your community user group member badge today!