English 中文(简体)
Lotus Domino不能将次级文件从一份文件转移到另一个文件?
原标题:Lotus Domino cannot move subdocuments from one document to another?

我们的Domino开发商告诉我们,“技术上不可能”在文件之间转移次文件。 情况如何?

Earlier this year he wrote for us a course registration system with the following database diagram:

database diagram

Now we asked him how to move waitlisted registrants from the full training sessions to those sessions that are not. He said it is impossible. He said we need to re-enter (recreate, copy and paste manually) the waitlist records because Domino cannot move attendees from one session to another.

We have over 1000 attendees in our waitlists.

Is he correct? Is this for real? We hope for a solution.

问题回答

How to do it depends on the way the documents are linked. But in any case it should be possible to relink the documents using code (formula/lotusscript/java).

Lotus设计师的帮助含有大量有关申请开发的信息。 另一个资源是IBM developerwork

There are numerous Lotus related blogs

From the Lotus Designer help: MakeResponse: Makes one document a response to another document. The two documents must be in the same database.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim docA As NotesDocument
Dim docB As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( "All documents" )
Set docA = view.GetFirstDocument
Set docB = view.GetNextDocument( docA )
Call docB.MakeResponse( docA )
docB.Form = "Response"
Call docB.Save( True, True )

There are 2 ways that documents can be linked: - via keys, the soft way - hierarchically, using a document-response link (i.e. parent-child)

如果只有逻辑联系,使用钥匙,你只得调整关键领域。 如果存在“物理”文件-反应联系,你可以轻松地打破和重新建立这种联系。 在Lotus出版社有《说明文件》。 • 向新父母提交文件。 如果这两种方法都使用,当然是多余的,但当你需要恢复某种联系时,则需要作两种改动。 通常情况下,某些关键领域从父母传给子女。

Just for testing purposes, you could try this: - select a response document that you want to hang elsewhere - Ctrl-X - select the new parent document - Ctrl-V

Do this in a test database, for the key fields won t be updated automatically. By the way: code can be written to repair the keys after pasting such a response document.

If you want to keep existing documents you could programmatically copy/duplicate them. It s quite easy using copyAllItems method.

http://www-12.lotus.com/ldd/doc/domino_notes/6.5m2/help65_ Designer.nsf/f4b82fbb75e942a6852566ac0037f284/8cb93284a7bf85d85256d420050c8cc?OpenDocument=“nofollow” here

您可以用说明复制文件 观点目标(目标一文件)/获得NextDocument(文件)方法,对说明文件的答复。 B. 应对措施

相信我们,这是可能的,Domino是灵活的:-

这些数据基本上有两种方式在你描述的数据模型中联系起来。 如果通过回复文件链接数据,就会与主要的文件结构稍有不同。

给你的开发商显示这一点,他实际上应当能够在守则中插手,使你所谈论的“出勤者”要求得以实现。

有几个问题值得注意。

  • I am assuming that all the data you need to manipulate is in one database.
  • I am taking your diagram you ve provided literally.
  • 对于主要的文件结构,你需要检查所查阅的文件所用的观点和关键价值。 具体检查“MoveAttendeesKeyBased”子中的这两条线:

    Set vwAttendeesByCourseID = db.GetView(“Lkup AllAttendeesByCourseID”)

    Set dcAttendees = vwAttendeesbyCourseID.Get AllDocumentsByKey (docCourseFrom.CourseID(0), Real)

  • The code is designed to look at a field called "CourseID", "Status" and the value of "Wait Listed" for the status value of attendees to be moved.

  • 这两本职能都用了20分钟。

应急文件结构

Sub MoveAttendeesResponseBased(docCourseFrom As notesDocument, docCourseTo As NotesDocument)
%REM
    A simple move attendees function if the relationship between courses and attendees is based on
    response document hierarchies
%END REM
    On Error Goto errHandle
    Dim dcAttendees As notesDocumentCollection
    Dim docAttendee As notesDocument
    Dim iAvailablePlaces As Integer
    Dim bMoved As Boolean

    If Not (docCourseFrom Is Nothing Or docCourseTo Is Nothing) Then        
        iAvailablePlaces = docCourseTo.availablePlaces(0)
        If 0 < iAvailablePlaces Then
            bMoved = False
            Set dcAttendees = docCourseFrom.Responses
            Set docAttendee = dcAttendees.GetFirstDocument
            While Not docAttendee Is Nothing And 0 < iAvailablePlaces
                If Ucase(Trim(docAttendee.Status(0)))= "WAIT LISTED" Then
                    Call docAttendee.MakeResponse(docCourseTo)
                    If docAttendee.Save(True,True) Then
                        iAvailablePlaces = iAvailablePlaces - 1
                        bMoved = True
                    End If
                End If
                Set docAttendee = dcAttendees.GetNextDocument(docAttendee)
            Wend
            If bMoved Then
                docCourseTo.availablePlaces = iAvailablePlaces
                Call docCourseTo.Save(True,False)
            End If
        End If
    End If  
    Exit Sub
errHandle:
    Messagebox Lsi_info(2) + " - " + Str(Err) + " : " + Error(Err) + ", at line " + Str(Erl)
    Exit Sub
End Sub

关键文件结构

Sub MoveAttendeesKeyBased(docCourseFrom As notesDocument, docCourseTo As notesDocument)
%REM
    A simple move attendees function if the relationship between courses and attendees uses 
    (non-response) key based documents
%END REM
    On Error Goto errHandle
    Dim session As New notesSession
    Dim dcAttendees As notesDocumentCollection
    Dim docAttendee As notesDocument
    Dim iAvailablePlaces As Integer
    Dim bMoved As Boolean
      a view that lists attendees by Course ID
    Dim vwAttendeesByCourseID As notesView
    Dim db As notesDatabase

    If Not (docCourseFrom Is Nothing Or docCourseTo Is Nothing) Then        
        iAvailablePlaces = docCourseTo.availablePlaces(0)
        If 0 < iAvailablePlaces Then
            Set db = session.CurrentDatabase
              do a lookup of all attendees based on the CourseFrom document course id
            Set vwAttendeesByCourseID = db.GetView(“Lkup AllAttendeesByCourseID”)
              this is the collection of all attendees under the CourseFrom document
            Set dcAttendees = vwAttendeesbyCourseID.Get AllDocumentsByKey (docCourseFrom.CourseID(0), Real)
            bMoved = False
            Set docAttendee = dcAttendees.GetFirstDocument
              While there are attendee documents to process and there are available places to goto
            While Not docAttendee Is Nothing And 0 < iAvailablePlaces
                  if the attendee s status is "Wait Listed" then move them
                If Ucase(Trim(docAttendee.Status(0)))= "WAIT LISTED" Then
                      Update the course ID for the Attendee
                    docAttendee.CourseID = docCourseTo.CourseID(0)
                    If docAttendee.Save(True,True) Then
                          decrement the available places
                        iAvailablePlaces = iAvailablePlaces - 1
                        bMoved = True
                    End If
                End If
                Set docAttendee = dcAttendees.GetNextDocument(docAttendee)
            Wend
            If bMoved Then
                  available places may be >= 0. Just update the available places so you don t over book the course
                docCourseTo.availablePlaces = iAvailablePlaces
                Call docCourseTo.Save(True,False)
            End If
        End If
    End If  
    Exit Sub
errHandle:
    Messagebox Lsi_info(2) + " - " + Str(Err) + " : " + Error(Err) + ", at line " + Str(Erl)
    Exit Sub
End Sub

重要文件的工作不多,但我认为是一个更好的结构,因为你可以很容易地将文件输入数据库,并从备份、复印件和过去恢复。 如果有答复文件,你可能会有问题,恢复备用贝卡应答文件,使用联合国国际交易日志的母文件,并且如果你因事故而搬走到来,也不可能知道,在没有原始课程信息的情况下,谁会回来,从而导致你回到文件的关键结构。 (千美元) 但这只是我的意见。





相关问题
Where are the javadocs for Lotus Notes.jar?

I need to use Lotus Notes/Domino as a data source from a Java application. The documentation at IBM says that the Notes.jar contains everything I will need, but where are the javadocs?

Is Interop.Domino dll thread safe?

I am using Interop.Domino dll version 1.2 in c# application, and using multithreading to access multiple NSF file at same time by creating new session for each thread created (Max 5 threads at a time)....

C#和Lotus Notes附录一

我正在使用C#,并需要附上一张空白(shortcut/link)档案和电子邮件给一个彩票账户。 问题是一对一幅通用形象的不实之词,没有像......那样显示双fold。

How to maintain Lotus Notes Version ? C#

I made one product which is retrieving attachment from mails and saving it on particular folder. But problem i am facing is it is not working in 8.0 version. I did development on Lotus Notes 8.5 ...

How to Edit NSF file using c#?

I want to programaticaly change some values to NSF item and then want to save it.(i.e to edit NSF File and then save the editions) for example: I want to set Sender name of all mails to "preeti@abc....

热门标签