1

I try to load a ListItemCollection from my SiteCollection using CSOM C#.

Therefore I use the following

List rr = web.Lists.GetByTitle("MyTitle");
context.Load(rr);

FieldCollection fcol = rr.Fields;
context.Load(fcol);

ListItemCollection rrCol = rr.GetItems(CamlQuery.CreateAllItemsQuery());
context.Load(rrCol);

context.ExecuteQuery();

Alright, so I'm retrieving a FieldCollection (this is jsut for me, to check what Column Names I have in the List) and I retrieve a ListItemCollection. I can see all ListItems I expect in the Collection, which is good.

But my problem is, some Values are not listed in the ListItem.

I want to read some FieldLookupValues. So normally I can go and write something like

 FieldLookupValue val1 = ((FieldLookupValue) item["lookupColumn"]);
 int id1 = val1.LookupId;

and for most of my LookupValues in the ListItem I can do that. But some of the Columnnames aren't listed.

I can't see some Lookups in the List, but some I can see. Whay could that be? When I take a look into the FieldCollection I can see there are 100 Fields in the List. But when I look into the ListItem I only see 77 Columnnames.

  • If your problem is only related to lookup fields, try to load one list referred by a lookup column and see if the field loads. – KhalilG Mar 11 '15 at 10:53
  • Doesn't work :( – Loki Mar 11 '15 at 10:56
  • Is the problem only related to lookup fields ? – KhalilG Mar 11 '15 at 11:01
  • Check the field names, on SharePoint go to the list paramaters, go into field values, and click on the fields you can't get. In the url, you can see the internal name. It's only a supposition, and if it's correct we'll dig further – Alex Mar 11 '15 at 11:03
  • 1
    I'm using the internal name. I can see the correct name of the column in the FieldCollection. But it's not listed in the Item itself. Though it has a value, when I use the browser to look into the Site Collection and view the List. – Loki Mar 11 '15 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.