I wanted to get the "DeliveredDate" of email from my local. While looping through my document I'm checking it using document.hasItem("DeliveredDate")
but returns me nothing.
Screenshot below:
//Search multiple query
docCount = view.FTSearch("Number of Samples: | \"Number of Inquiry:\" | \"Number of Universe:\" | \"Request Type:\"");
doc = view.getFirstDocument(); //Returns the first document in a view.
while(doc != null)
{
if(doc.hasItem("DeliveredDate"))
{
System.out.println(true);
}
else
{
System.out.println(false);
}
doc = view.getNextDocument(doc);
}
答案 0 :(得分:0)
它实际上可能是空的,尝试这种方法(在@formula中的逻辑下面)。
@If(DeliveredDate != ""; DeliveredDate; PostedDate != ""; PostedDate; @Created)
请阅读此处了解更多详情(有关于DeliveredDate和PostedDate的信息): Why is the date shown in Inbox folder different from that shown when the document is opened?
<强>更新强>
您不应将doc.getItemValue(“DeliveredDate”)用作字段DeliveredDate是Date。基本上你需要使用Item(参见下面的例子)。 您有两个选择:
System.out.println(doc.getFirstItem("DeliveredDate").getText());
或
System.out.println(doc.getFirstItem("DeliveredDate").getDateTimeValue().getLocalTime())