0
我正在使用CSOM從sharePoint聯機檢索數據。 我需要從文檔庫中獲取數據。這裏是我用來檢索數據的語法。SharePoint查找字段返回空值
List list = clientContext.Web.Lists.GetByTitle("Required Documents");
if (list != null)
{
CamlQuery caml = new CamlQuery();
caml.ViewXml = @"<View>
<Query>
<Where>
<Eq>
<FieldRef Name='PONo' />
<Value Type='Lookup'>" + poNo + @"</Value>
</Eq>
</Where>
</Query>
</View>";
ListItemCollection items = list.GetItems(caml);
clientContext.Load<ListItemCollection>(items);
clientContext.ExecuteQuery();
這裏PONo是另一個列表項的查找。 所以我試圖得到如下的值,但它返回null。
var itm = item.FieldValues["PONo"] as FieldUserValue;
當嘗試這樣,
var itm = item.FieldValues["PONo"];
它返回要緊的值。會有什麼問題?
感謝您的支持。 – RiksonTool