RenderListDataAsStream Not Working with Workflow Tasks List
When we try to use the RenderListDataAsStream with WorkFlow Tasks List we get the error "You can only query for the HierarchyQueryInterface after hierarchy has been reserved"
What is your key code and config? The RenderListDataAsStream should works well.
My worked code:
// const listId = this.context.pageContext.list.id;
//const itemId = this.context.pageContext.listItem.id;
//const restAPI = ${this.context.pageContext.web.absoluteUrl}/_api/web/Lists(guid'${listId}')/RenderListDataAsStream;
const listId = "my Task lit guid";
const itemId = 2;
const restAPI = ${this.context.pageContext.web.absoluteUrl}/_api/web/Lists('${listId}')/RenderListDataAsStream;
this.context.spHttpClient.post(restAPI, SPHttpClient.configurations.v1, {
body: JSON.stringify({
parameters: {
RenderOptions: 2,
ViewXml: <View>
<ViewFields>
<FieldRef Name="ValoNavigation"/>
</ViewFields>
<Query>
<Where>
<Eq>
<FieldRef Name="ID"/>
<Value Type="Number">${itemId}</Value>
</Eq>
</Where>
</Query>
<RowLimit Paged="TRUE">1</RowLimit>
</View>
}
})
})
.then((data: SPHttpClientResponse) => data.json())
.then((data: any) => {
if (data && data.Row && data.Row.length > 0) {
// Start writing your code here
this.domElement.innerHTML = `
</div>`;
} });
Thanks. This worked. May be the ViewFields is a requirement. Without it we got the error I have mentions.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues