java - 如何在Lotus中使用java从字段中获取日期时间值

标签 java lotus-notes

我使用 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/

相关文章:

java - LanguageTool Java API 是否有 "useless"依赖项?

azure - 如何使用 Azure OAuth 或 Azure API 网关保护 Open xpage REST API

java - 重复中组合框的选择

excel - 从 Excel VBA 访问 Lotus Notes 数据库 - 如何选择 COLUMNVALUES?

java - 是否可以为 @RequestMapping 使用字符串而不是字符串文字的值?

java - 为什么 setLocation() 不移动我的标签?

database - 我可以访问 Lotus Notes 的数据库吗?

oracle - 用于设计的 Lotus Notes XPage 和用于数据的 Oracle(或其他 RDBMS)

java - 使用 Spring JPA 查询从序列中获取 nextval

java - 检查Firebase数据库中是否存在值