mercredi 11 mars 2015

CSOM retrieve List Item doesn't show some Lookup Key Value pairs



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.








0 commentaires:

Enregistrer un commentaire