复制文档已保存但原始文档未使用 lotusscript 更改状态
Copy document is saved but original not changes status using lotusscript
我有两份文件,一份是原件,一份是复印件。当我保存副本时,原件也会改变状态。
跟进我的另一个问题 。下面是我的代码。
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim activeDoc As NotesDocument
Dim view As NotesView
Dim keys(1) As String
'// Set database and doc
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
keys(0) = doc.PTagNo(0)
keys(1) = "Lock"
Set view = db.GetView("Computer")
vpswd = Inputbox$("Pls input code to save :")
If vpswd = "o" Then
Set activeDoc= view.GetDocumentByKey(keys, True)
If Not activeDoc Is Nothing Then
If activeDoc.PStatus(0) = "Lock" Then
activeDoc.DocumetId = doc.UniversalID
Call activeDoc.ReplaceItemValue("PStatus", "Inactive")
Call activeDoc.Save(True, False)
End If
End If
Call uidoc.FieldSetText("PStatus" , "Active")
Call uidoc.FieldSetText("SaveOptions" , "1")
Call uidoc.Save
Call uidoc.Close
Else
Msgbox "Wrong Code"
Exit Sub
End If
End Sub
我已经设置变量并成功保存。当我保存时,复制文档被保存并更改状态为活动,但对于当前状态为 "Lock" 的当前文档,没有更改为 "Inactive" 状态。谁能帮我?我在编码内部有什么错误吗?非常感谢您的帮助。谢谢!
我已经解决了这个问题。对于我的问题,我没有将 TagNo 设置为我的第一列。所以我需要创建包含两列的新视图,即 TagNo 和 Status。将两列都设置为升序。
我有两份文件,一份是原件,一份是复印件。当我保存副本时,原件也会改变状态。
跟进我的另一个问题
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim activeDoc As NotesDocument
Dim view As NotesView
Dim keys(1) As String
'// Set database and doc
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
keys(0) = doc.PTagNo(0)
keys(1) = "Lock"
Set view = db.GetView("Computer")
vpswd = Inputbox$("Pls input code to save :")
If vpswd = "o" Then
Set activeDoc= view.GetDocumentByKey(keys, True)
If Not activeDoc Is Nothing Then
If activeDoc.PStatus(0) = "Lock" Then
activeDoc.DocumetId = doc.UniversalID
Call activeDoc.ReplaceItemValue("PStatus", "Inactive")
Call activeDoc.Save(True, False)
End If
End If
Call uidoc.FieldSetText("PStatus" , "Active")
Call uidoc.FieldSetText("SaveOptions" , "1")
Call uidoc.Save
Call uidoc.Close
Else
Msgbox "Wrong Code"
Exit Sub
End If
End Sub
我已经设置变量并成功保存。当我保存时,复制文档被保存并更改状态为活动,但对于当前状态为 "Lock" 的当前文档,没有更改为 "Inactive" 状态。谁能帮我?我在编码内部有什么错误吗?非常感谢您的帮助。谢谢!
我已经解决了这个问题。对于我的问题,我没有将 TagNo 设置为我的第一列。所以我需要创建包含两列的新视图,即 TagNo 和 Status。将两列都设置为升序。