
Announcements
I am trying to build a query that will retrieve the list of absolute URL of documents linked to products. I validated that there are documents, and can see them from Dynamics. I built a simple fetch XML like this one, and it doesn't return anything for the absolute URL, it's blank:
<fetch top="50">
<entity name="product">
<attribute name="anca_productdisplayname" />
<attribute name="anca_productname" />
<attribute name="productid" />
<filter>
<condition attribute="productid" operator="eq" value="00000000-0000-0000-0000-000000000000" />
</filter>
<link-entity name="sharepointdocument" from="regardingobjectid" to="productid" link-type="outer" alias="sp">
<attribute name="absoluteurl" />
<attribute name="filetype" />
</link-entity>
</entity>
</fetch>
I also noticed that expanding the 'sharepointdocument' entity works fine when querying the WebAPI directly to a record, but not when using a filter, which technically returns the same thing:
Works
/api/data/v9.0/products(00000000-0000-0000-0000-000000000000)?$select=productid&$expand=Product_SharepointDocument($select=sharepointdocumentid,fullname,absoluteurl,documentid,filetype),Product_SharepointDocument($top=1)
Doesn't work
/api/data/v9.0/products?$filter=productid eq 00000000-0000-0000-0000-000000000000&$select=productid&$expand=Product_SharepointDocument($select=sharepointdocumentid,fullname,absoluteurl,documentid,filetype),Product_SharepointDocument($top=1)
Is this a known limitation of the API, or am I doing something wrong with my queries?
Absolute URL is a field on the Document Location record, it is not auto populated. The Document Location will have the Folder and a Parent Lookup, meaning the data exists to construct the full URL - but it is not structured for easy querying due to it being recursive back to the SharePoint site.
Also, I have seen both Absolute and Relative URL being used in the one implementation, part of it was out-of-the-box (the relative), and then someone had coded the creation of some Document Locations and used Absolute ones for these.