验证 Richtext 字段中的附件
我使用下面的代码来验证 Richtext 字段中的附件。
如果我不会使用 Call source.Refresh(True) 那么验证不起作用,但是每次在按钮中调用 querysave 时,此代码也会刷新文档。
那么是否有任何选项或任何其他想法,以便我不应该使用此刷新部分或整个代码来验证。
如果有人有更有效的代码,请分享。
If Source.Document.YesNo20(0)="Yes" Then
Call source.Refresh(True)
Dim rtitem As NotesRichTextItem
Set rtitem = source.Document.GetFirstItem( "Atchmnt20" )
NotesEmbeddedObjectArray = rtitem.EmbeddedObjects
If Isempty ( NotesEmbeddedObjectArray ) Then
Messagebox "Please enter an attachment in 20a. As you selected option Yes"
continue=False
Exit Sub
End If
End If
I am using below code to validate the Attachment in Richtext field.
If I will not used Call source.Refresh(True)
then validation is not working, but this code is also refreshing document everytime querysave is called in buttons.
So is there any option or any other idea so that I should not user this Refresh part or entire code to validate .
If anybody have more efficient code then please share this.
If Source.Document.YesNo20(0)="Yes" Then
Call source.Refresh(True)
Dim rtitem As NotesRichTextItem
Set rtitem = source.Document.GetFirstItem( "Atchmnt20" )
NotesEmbeddedObjectArray = rtitem.EmbeddedObjects
If Isempty ( NotesEmbeddedObjectArray ) Then
Messagebox "Please enter an attachment in 20a. As you selected option Yes"
continue=False
Exit Sub
End If
End If
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
LotusScript 中有一种方法可以检查附件是否存在,甚至对于新的(未保存的)文档也是如此。
创建一个隐藏的计算字段,例如 AttachmentNames,其公式为:
@If(@AttachmentNames!=""; "1"; "");
在 LotusScript 中执行以下操作:
There's a way in LotusScript to check attachments presence even for new (not saved) documents.
Create a hidden computed field, for instance AttachmentNames with formula:
@If(@AttachmentNames!=""; "1"; "");
In LotusScript do the following:
验证 Lotus Notes 中的富文本字段有点像黑暗艺术,但您能不这样做吗? (其中
doc
是后端):您还可以做其他事情。查看这篇 Lotus Developer Domain 帖子,其中涵盖附件、文本、嵌入对象等各种内容:
http://www-10.lotus.com/ldd/nd6forum.nsf/0/8b3df10667d355768525719a00549058
Validating rich text fields in Lotus Notes is a bit of a dark art, but can you not just do this? (where
doc
is the back-end):There are other things you can do. Check this Lotus Developer Domain post, which covers attachments, text, embedded objects, all sorts:
http://www-10.lotus.com/ldd/nd6forum.nsf/0/8b3df10667d355768525719a00549058
你能用公式验证 RT 字段吗?
我使用以下输入验证公式在富文本字段下方创建了一个隐藏字段:
Can you validate RT field with formula?
I created a hidden field below my rich text field with this Input Validation formula:
假设您想避免刷新,因为它花费的时间太长,以下是您可能想要查看的内容,如果可行,请尝试更改:
Assuming that you want to avoid the Refresh because it takes too long, here is what you may want to look at and if feasible, try to change: