I would like to add a link to the Entity table in this query:
<fetch version="1.0" >
<entity name="audit" >
<all-attributes/>
</entity>
</fetch>
I have tried to use the ObjectTypeCode attribute but link to the Product table, but there seems to be no corresponding value (ObjectTypeCode for Product is 1024).
Thank you for your help.
Unfortunately, you cannot join the related tables just like that with
audit
table. Moreover the query may need UNION to join based onobjecttypecode
with different tables. FetchXML does not support UNION.The
audit
table is little tricky, it is not like any other entity - as some of the data is stored in denormalized and delimiter separated values in columns likechangedata
. Also relationship is not maintained betweenaudit
and other tables other thansystemuser
. Read moreYou can play around the audit table using XrmToolBox FetchXML builder and observe them.
Web api endpoint for audit entity is below:
Very interesting part is
$filter=objecttypecode eq 'account'
in above web api query. I don't know how is this even working. This is contradicting between web api and fetchxml.