Hi community
I have the following fetchxml query which works fine when executed from FetchXml Tester and FetchXML Builder in XrmToolBox.
It returns details of associated documents held in SharePoint as expected.
However if I try and excute the query from within a portal page no data is returned. I suspect this is permissions related.
I have created a table permission for the sharepointdocument entity with access type Account and account relationship Account_SharepointDocument. There are no web roles associated with it.
Sharepoint Integration is on.
What am I missing?
Thanks
The query runs at the fetchxml tag.
Isolate which tag is throwing the error - Put some text/html before each Liquid tag, the last bit of text you see on the web page will then be just before the Liquid tag that is failing.
It is saying somewhere on that page you have syntax error. Isolate if it is the fetchxml statement or not (also take the fetchxml and put it into fetchxml builder or tester in XrmToolBox and confirm it is correct), also look at the value(s) you are substituting in to the fetchxml
Hi @Fubar
It is the name of the test page where we are running the fetchxml. The output of the query will be used to populate a kendo grid
No idea - where does the 'kendo' in the error come from?
Hi Fubar
Thanks for the reply, apologies for the delay in replying.
I have created the table permissions as suggested. However when I try and access the result entities returned by the query I get this error in the browser console -
Uncaught SyntaxError: Unexpected identifier 'error' (at testcontractdocumentskendo/:1346;16)
When viewed in the Sources tab the error is -
"Liquid error: Exception has been thrown by the target of an invocation."
The query and the liquid code which follows the query is as follows
The error is thrown by the liquid code where I'm attempting to retrieve the results returned by the query
{% fetchxml sharepointdocuments %}
<fetch>
<entity name="sharepointdocument">
<attribute name="documentid" />
<attribute name="fullname" />
<attribute name="absoluteurl" />
<attribute name="relativelocation" />
<attribute name="sharepointcreatedon" />
<attribute name="filetype" />
<attribute name="modified" />
<attribute name="sharepointmodifiedby" />
<attribute name="title" />
<attribute name="readurl" />
<attribute name="editurl" />
<attribute name="author" />
<attribute name="sharepointdocumentid" />
<attribute name="ischeckedout" />
<attribute name="locationid" />
<attribute name="iconclassname" />
<order attribute="relativelocation" descending="false" />
<link-entity name="new_agreement" from="new_agreementid" to="regardingobjectid" link-type="inner" alias="ad">
<filter type="and">
<condition attribute="new_agreementid" operator="eq" value="<some agreement id>" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
{% assign results = sharepointdocuments.results.entities %}
I based my query on the following
Do you have any suggestions what the target is that the error is referring to?
Is it possible to get more details about a liquid error?
Thank you
Not "Self", self is only for the Portal User to be able to access their own Contact record (e.g. update their details on the Profile Page).
In what I was describing, you would use Scope = Parent on the sharepoint table permission, and then choose the relationship/table permission for the the link table (your agreement table).
Okay, that didn't work. My page threw the error
Liquid error: Entity Permission SharePointDocumentRead c2c46ddc-8bf5-ee11-a1fd-000d3a210e73 Scope value Self is not applicable to entity sharepointdocument.
I've set
Access Type - Account
Account Relationship - Account_SharePointDocument
and now I get
Liquid error: Exception has been thrown by the target of an invocation
What is throwing the error is this liquid which is executed after the fetchxml
Hi @Fubar
Thanks for the reply.
When you say ...
'Unless there was a specific requirement to put an Account Lookup on the sharepointdocument table, I would probably do a Table permission on new_agreement (that is Account assuming it has a lookup to Account that is being populated), and then a Child permission (i.e. Scope = Parent) between new_agreement and sharepointdocument.'
... what would the Access Type for sharepointdocument be, I've set it to Self
My permissions now look like
Web roles have been applied to both
Thanks
For a Table Permission to work it must be associated with a Web Role that is being used by the Portal User.
Account scope on a Table permission means that you have a Lookup on the Table in question to Account and the portal user's parent account (using the out of the box relationship/lookup) is the account populated in the Lookup.
Note: you would need a Table permission for both of the Tables in the query.
Unless there was a specific requirement to put an Account Lookup on the sharepointdocument table, I would probably do a Table permission on new_agreement (that is Account assuming it has a lookup to Account that is being populated), and then a Child permission (i.e. Scope = Parent) between new_agreement and sharepointdocument.
Child (scope parent) means you do not need a lookup on the other table e.g. if you had an Invoice and Invoice Line Items, you wouldn't put an Account lookup on each line item just on the Invoice, and you would then use a Child Table Permission between Invoice and Invoice Line Item).
Lucas001
60
Super User 2025 Season 1
Fubar
55
Super User 2025 Season 1
surya narayanan
35