logo

New Response

« Return to the blog entry

You are replying to:

  1. this is how it could work:

    dim s as New NotesSession

    Dim db1 as NotesDatabase

    Dim db2 as NotesDatabase

    Dim newDoc as NotesDocument

    Dim oldDoc as NotesDocument

    Dim newResponse as NotesDocument

    set db1 = s.currentdatabase

    set db2 = new NotesDatabase(db1.server, db1.filepath)

    set newDoc = s.documentcontext

    set oldDoc = db2.getdocumentbyuniqueid(newDoc.universalid)

    set newResponse = new NotesDocument(db2)

    call oldDoc.copyallitems(newResponse)

    call newResponse.makeresponse(oldDoc)

    call newResponse.save(true,true)

    set oldDoc = nothing

    set newResponse = nothing

    set db2 = nothing

    ------------

    Typed that from memory, so syntax might not be accurate. The trick: Open the db twice and you can have two different handles. Worked in the compare changes db (see previous post). Feedback would be nice.

    ---------------------------------------

    Of course there is another way!!!!

    It includes to tweak with Domino's actions. You can do that with JS: Get the form element and change the action property to point to "?CreateDocument" instead of "?EditDocument&Sequ..."

    This way Domino would create a brand new document... If you have it's original UNID as a hidden field you then could easily do the trick since documentcontext and old document are 2 items. You would need to save the new document in code (to get the unid fixed) and use saveoptions=0 to avoid that the QS tries to save it a second time.

    ------------

    Hth

    ;-) stw

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: