I have a provider hosted app and i want to retrieve the list item version history with all the columns of an item in my provider hosted app using CSOM. I tried using CAML Query but i am not able to achieve the required functionality. Any pointer will be helpful.
Asked
Active
Viewed 653 times
1 Answers
0
When loading file, use lambda expression to explicitly request all required attributes.
Microsoft.SharePoint.Client.File file = context.Web.GetFileByUrl("URL_of_FILE"); //Can be referenced however you want
context.Load(file, x=>x.ListItemAllFields, x=>x.Versions);
//Execute query to reference attributes
context.ExecuteQuery();
To reference specific column values:
string columnVal= file.ListItemAllFields["col_val_id"].ToString();

KiteCoder
- 2,364
- 1
- 13
- 29
-
1this is for file, not for list item. OP asked specifically for list item – Diomos Jun 26 '18 at 18:41