Frage

I m trying to get all tasks, which have given task as a parent using CSOM:

projContext.Load(tasks, c => c.Where(t => t.Parent.Id == parentId));

Here projContext is a valid context and parentId is the Id of a valid task.

I get error:

[Microsoft.SharePoint.Client.ServerException] {"Unknown Error"} at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

What is wrong? How to do it correctly? Thank you.

War es hilfreich?

Lösung

Try changing the query to this: projContext.Load(tasks, c => c.Where(t => t.Parent != null && t.Parent.Id == parentId));

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange
scroll top