Lotus 错误 "Could not create field %1"

  

While running LotusScript code, the following error message occurs:


  • "Could not create field %1"

What does this error mean?

Answer

This error is displayed when you try to assign an invalid array to a field. Examples of invalid arrays would be an array containing different data types, or an array that would exceed the storage capacity of the field.

A simple example code that generates this error would be as follows:
Sub Initialize
Dim sess As New notesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim arr(1) As Variant

Set db = sess.CurrentDatabase
Set doc = db.CreateDocument

arr(0) = ""
arr(1) = Datevalue("1 Jan 2004")
doc.NewField = arr
End Sub

Note that a different error is displayed if you use the ReplaceItemValue method of the NotesItem class, rather than the "dot" notation that treats the field as a property of the document. If you replace this line:

  • doc.NewField = arr

in the example above with:
  • Call doc.ReplaceItemValue("NewField", arr)

you see the error message:
  • Notes error: NotesItem cannot be set to an array of mixed data types

In the case of an array that would exceed the capacity of the field, the error message when using ReplaceItemValue is

  • Notes error: Adding entry will cause text list to exceed 64K. Entry not added
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值