1

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.

Kalpesh
  • 149
  • 1
  • 2
  • 13

1 Answers1

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