我使用IBM Notes和IBM Domino Designer。我有一个带有日期/时间字段的表格。这个字段被称为“ Orderdatum”,来自一个Java代理,我通过最终执行此操作来将此字段称为:

orderDocument.getItemValueDateTimeArray("Orderdatum")


如果填写了它就可以了,但是如果它是空的,我会得到这个:

NotesException: Item value is not a date type
    at lotus.domino.local.Document.NgetItemValueDateTimeArray(Native Method)
    at lotus.domino.local.Document.getItemValueDateTimeArray(Unknown Source)
    at JavaAgent.postOrder(Unknown Source)
    at JavaAgent.NotesMain(Unknown Source)
    at lotus.domino.AgentBase.runNotes(Unknown Source)
    at lotus.domino.NotesThread.run(Unknown Source)


即使我进行如下检查:

if(orderDocument.getItemValueDateTimeArray("Orderdatum") != null){
if(!orderDocument.getItemValueDateTimeArray("Orderdatum").equals(null)){


我仍然在控制台中收到错误,如何避免这种情况。

最佳答案

用这个:

if(orderDocument.getItemValue("Orderdatum") != null){

关于java - 如何在Lotus中使用Java从字段获取日期时间值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40528515/

10-10 02:33