Lotus Notes 7 - 复制/移动文档。 (父母&响应文档),而不更改UNID? [英] Lotus Notes 7 - copy / move docs. ( parent & response docs ) without changing the UNID ?

查看:552
本文介绍了Lotus Notes 7 - 复制/移动文档。 (父母&响应文档),而不更改UNID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个数据库:let say dbA和dbB。实际上,dbB是dbA的子数据库,因为它包含的所有表单/ views / frameset / etc都在dbA中。



现在,从一个视图(让说vwA)从dbA一些8K文档复制到同一个视图(vwA)从dbB。 THese 8k包含父文档和子文档,在dbA中列出了OK,使用@Text(@UniqueDocumentID)。我只是做了一个测试,复制一个父文档及其响应,并粘贴在第二个数据库,但不幸的是,2个文档之间的连接没有...我想UNID已经改变...



有没有解决方案?感谢您的时间。

解决方案

是,将文档复制到另一个数据库始终在目标数据库中创建一个新的通用文档。 / p>

为避免这种情况,您的LotusScript应该工作如下:




  • 在目标数据库中

  • CopyAllItems 从源文档到目标文档

  • 将相同的通用ID设置为目标 targetDoc.UniversalID = sourceDoc.UniversalID

  • 保存目标文档



这样,目标文档具有与源文档相同的UniversalID,并且文档之间的链接也应该在目标数据库中工作。



一个在所选文档上工作的代理的示例:

  Dim会话作为新NotesSession 
Dim dbSource As NotesDatabase
Dim dbTarget As NotesDatabase
Dim col As NotesDocumentCollection
Dim docSource As NotesDocument
Dim docTarget As NotesDocument

设置dbSource = session.Currentdatabase
设置dbTarget = session.Getdatabase(dbSource.Server,YourTargetDatabase.nsf,false)
设置col = dbSource.Unprocesseddocuments
设置docSource = col.Getfirstdocument()
而不是docSource不是
设置docTarget = dbTarget.Createdocument()
调用docSource.Copyallitems(docTarget,true)
docTarget.UniversalID = docSource.UniversalID
调用docTarget.save(True,False)
设置docSource = col.Getnextdocument(docSource)
Wend


I have 2 databases : let say dbA and dbB. Actually, dbB is a ''child'' database of dbA, because the forms/views/frameset/etc that it contains they all are also in dbA.

I want now, to copy from a view ( let say vwA ) from dbA some 8K docs to the same view ( vwA ) from dbB. THese 8k contains both parent and child docs, which in dbA are listing OK, with @Text(@UniqueDocumentID). I just made a test, copy one parent doc and its response, and pasted in the 2nd database, but unfortunately the connection between the 2 docs isn't made... I guess the UNID had changed...

Is there any solutions? Thanks for your time.

解决方案

Yes, copying a document to another database always creates a new UniversalIDs for document in target database.

To avoid this, your LotusScript should work like this:

  • create new document in target database
  • CopyAllItems from source document to target document
  • set same UniversalID to target document targetDoc.UniversalID = sourceDoc.UniversalID
  • save the target document

This way the target document has the same UniversalID like the source document and links between document should work in target database too.

This is an example for an agent working on selected documents:

Dim session As New NotesSession
Dim dbSource As NotesDatabase
Dim dbTarget As NotesDatabase
Dim col As NotesDocumentCollection
Dim docSource As NotesDocument
Dim docTarget As NotesDocument

Set dbSource = session.Currentdatabase
Set dbTarget = session.Getdatabase(dbSource.Server, "YourTargetDatabase.nsf", false)
Set col = dbSource.Unprocesseddocuments
Set docSource = col.Getfirstdocument()
While Not docSource Is Nothing
    Set docTarget = dbTarget.Createdocument()
    Call docSource.Copyallitems(docTarget, true)
    docTarget.UniversalID = docSource.UniversalID
    Call docTarget.save(True, False)
    Set docSource = col.Getnextdocument(docSource)
Wend

这篇关于Lotus Notes 7 - 复制/移动文档。 (父母&响应文档),而不更改UNID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆