Option-1:
有几种方法可以做到这一点,最简单的是,正如用户之前指定的,一个简单的字段函数就可以了。
FIELD UserName := UserNAme:InternetAddress;
您可以在 $UsersView 的代理中设置和运行上述字段函数
在选项 2 中,您还可以使用“UnProcessedDoc”功能并设置并作为代理运行。
但是,在这里,我编写了另一种在 $UsersView 中设置和作为代理运行的方法。
希望这有帮助,如果这对任何人有帮助,请批准此答案。
Option:2
目前我的系统中没有Domino,为了测试这个sn-p。我希望在我发布之前有任何在线方法来测试这个 sn-p。
但是,从逻辑上讲,将此 sn-p 视为实现您的目标的伪代码。
最重要的是,自从我在 Domino 中编程以来已经有十多年了。因为,我转向了 RDMS、DW、BI,现在转向了 Cloud……以及 Cloud-9。 :)
这里是一部分 lotus 脚本代码,用于将个人文档中 InternetAddress 字段中的值一一复制到 names.nsf 中,并将其附加到 UserName 字段中。
Dim db As New NotesDatabase( "Names Db", "names.nsf" )
Dim view As NotesView
Dim doc As NotesDocument
Dim InternetAddress_value As Variant
Set view = db.GetView( "$Users" )
// loop thru all docs in $Users view.
// Get InternetAddress_value and rep it in UserName
Set doc = view.GetFirstDocument
If doc.HasItem("InternetAddress") Then
While Not(doc Is Nothing)
// in this line we concatenate username with IAaddress_value
new_value= doc.GetItemValue( "username" ) + doc.GetItemValue( "InternetAddress" )
Call doc.ReplaceItemValue( "UserName", new_value)
Call doc.Save( False, True )
Set doc = view.GetNextDocument(doc)
Wend
End If
此解决方案由 Mangai@Notes@Domino@Now_HCL 发布。通过批准答案鼓励发布更多解决方案。