I am trying to query data from a list using client object model. Everything is working except mysteriously one particular field is not. They are all being pulled the same way (mostly) and I can go and look at the list and see that clearly there is data in the field but it is just not being returned. Is there something I am missing here? Is there some sort of different type of field setting that could cause this (this is just a text field btw)?
HostWeb = Context.Web;
Context.Load(HostWeb, w => w.Lists);
//Load The Drop off box documents list
DropOffBox = HostWeb.Lists.GetByTitle("Drop-off Box");
Context.Load(DropOffBox);
CamlQuery DropOffQuery = new CamlQuery();
DropOffQuery.ViewXml = "<View><Query><OrderBy><FieldRef Name='Number' /></OrderBy></Query></View>";
DropOffItems = DropOffBox.GetItems(DropOffQuery);
Context.Load(DropOffItems, items => items.Include(i => i.DisplayName, i => i["ows_Modified"], i => i["Recipient"], i => i["Url"],
i => i["Location"], i => i["Number"], i => i.Id));
Context.ExecuteQuery();
foreach (ListItem Item in DropOffItems)
{
FilerDocument Doc = new FilerDocument(Item.DisplayName, DateTime.Parse(Item["ows_Modified"].ToString()), (Item["Recipient"] ?? "").ToString(),
Item["Url"].ToString(),Item.Id.ToString(), _serverName);
Doc.FiledUrl = (Item["Location"] ?? "").ToString();
Doc.Number = (Item["Number"] ?? "").ToString();
Doc.PropertyChanged += new PropertyChangedEventHandler(Document_PropertyChanged);
DropOffDocs.Add(Doc);
}
The part that is failing is the "Number" field. All the other fields work fine, including location which is being accessed in the same exact way and is coming from the same contenttype.