sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

RenderListDataAsStream Not Working with Workflow Tasks List

Open nikolayyordanov opened this issue 8 years ago • 3 comments

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"

nikolayyordanov avatar Sep 28 '18 13:09 nikolayyordanov

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 = `

${data.Row[0]["FSObjType"}

  </div>`;

} });

Seiyasu avatar Oct 01 '18 06:10 Seiyasu

Thanks. This worked. May be the ViewFields is a requirement. Without it we got the error I have mentions.

nikolayyordanov avatar Oct 01 '18 09:10 nikolayyordanov

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

msft-github-bot avatar Jan 26 '20 12:01 msft-github-bot