Skip to main content
added 329 characters in body
Source Link

I've found a workaround:

var loadedListItems = new List<ListItem>();

using (var clientContext = new ClientContext(myUrl))
{
    var list = clientContext.Web.Lists.GetByTitle(configuration.ListName);
    
    var camlQuery = CamlQuery.CreateAllItemsQuery();
    var listItems = list.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();

    foreach (var loadedListItem in listItems.ToList().Select(x => list.GetItemById(x.Id)))
    {
        clientContext.Load(loadedListItem);
        clientContext.ExecuteQuery();

        loadedListItems.Add(loadedListItem);
    }
}

Note how the code iterates through the result of list.GetItems(camlQuery); and then executes list.GetItemById(x.Id) for each result. This does indeed work and returns items with "Author" and "Editor" filled in.

Important note: I do realize the performance impact (right now this takes 40-50 seconds), but this is the only solution that has solved my problem. I'd much rather have someone solve the issue that is causing the impossibility to retrieve those values via the regular query, but apparently that isn't happening.

I've found a workaround:

var loadedListItems = new List<ListItem>();

using (var clientContext = new ClientContext(myUrl))
{
    var list = clientContext.Web.Lists.GetByTitle(configuration.ListName);
    
    var camlQuery = CamlQuery.CreateAllItemsQuery();
    var listItems = list.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();

    foreach (var loadedListItem in listItems.ToList().Select(x => list.GetItemById(x.Id)))
    {
        clientContext.Load(loadedListItem);
        clientContext.ExecuteQuery();

        loadedListItems.Add(loadedListItem);
    }
}

Note how the code iterates through the result of list.GetItems(camlQuery); and then executes list.GetItemById(x.Id) for each result. This does indeed work and returns items with "Author" and "Editor" filled in.

I've found a workaround:

var loadedListItems = new List<ListItem>();

using (var clientContext = new ClientContext(myUrl))
{
    var list = clientContext.Web.Lists.GetByTitle(configuration.ListName);
    
    var camlQuery = CamlQuery.CreateAllItemsQuery();
    var listItems = list.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();

    foreach (var loadedListItem in listItems.ToList().Select(x => list.GetItemById(x.Id)))
    {
        clientContext.Load(loadedListItem);
        clientContext.ExecuteQuery();

        loadedListItems.Add(loadedListItem);
    }
}

Note how the code iterates through the result of list.GetItems(camlQuery); and then executes list.GetItemById(x.Id) for each result. This does indeed work and returns items with "Author" and "Editor" filled in.

Important note: I do realize the performance impact (right now this takes 40-50 seconds), but this is the only solution that has solved my problem. I'd much rather have someone solve the issue that is causing the impossibility to retrieve those values via the regular query, but apparently that isn't happening.

Source Link

I've found a workaround:

var loadedListItems = new List<ListItem>();

using (var clientContext = new ClientContext(myUrl))
{
    var list = clientContext.Web.Lists.GetByTitle(configuration.ListName);
    
    var camlQuery = CamlQuery.CreateAllItemsQuery();
    var listItems = list.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();

    foreach (var loadedListItem in listItems.ToList().Select(x => list.GetItemById(x.Id)))
    {
        clientContext.Load(loadedListItem);
        clientContext.ExecuteQuery();

        loadedListItems.Add(loadedListItem);
    }
}

Note how the code iterates through the result of list.GetItems(camlQuery); and then executes list.GetItemById(x.Id) for each result. This does indeed work and returns items with "Author" and "Editor" filled in.