<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум компьютерной помощи &mdash; Агент переноса документов в архив]]></title>
	<link rel="self" href="https://itpmr.ru/extern.php?action=feed&amp;tid=1072&amp;type=atom" />
	<updated>2019-04-22T07:29:52Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=1072</id>
		<entry>
			<title type="html"><![CDATA[Re: Агент переноса документов в архив]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124751#p124751" />
			<content type="html"><![CDATA[<p>После успешной работы агента все документы с вьюхи можно удалить.</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-22T07:29:52Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124751#p124751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Агент переноса документов в архив]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124750#p124750" />
			<content type="html"><![CDATA[<p>Данный агент переносит документы с вьюхи admin_arc_allreg_2017 с формулой отбора <br /></p><div class="codebox"><pre><code>SELECT ((Form = &quot;incoming&quot;) | (Form = &quot;inside&quot;) | (Form = &quot;outgoing&quot;)) &amp;  (@Contains(archive; &quot;1&quot;))&amp; (!@Contains(responce; &quot;1&quot;))  &amp; (datereg&lt;=[01/01/2018] ) &amp; (datereg&gt;=[01/01/2017] )</code></pre></div><p>Все документы за 2017 год в базу documents2017.nsf.<br />При этом UniversalID в архиве и те что были в текущей базе - совпадают. <br /></p><div class="codebox"><pre><code>Dim session As New NotesSession    
    Dim db As NotesDatabase, workdb As NotesDatabase
    Dim view As NotesView
    Dim doc As NotesDocument, newdoc As NotesDocument
    Dim server As String
    &#039;
    Dim dc As NotesDocumentCollection
    Dim ftdoc As notesdocument
    Dim  ftnewdoc As  NotesDocument
    Dim  nextftdoc As  NotesDocument
    
    On Error Goto Errh
    Set db = session.CurrentDatabase
    server = db.Server
    Set view=db.GetView(&quot;admin_arc_allreg_2017&quot;)
    Set workdb = New NotesDatabase( server, &quot;promdoc\documents2017.nsf&quot; )
    
    Set doc = view.GetFirstDocument
    While Not (doc Is Nothing)
        
        Set newdoc=workdb.CreateDocument        
        Call doc.CopyAllItems(newdoc,1)
        newdoc.UniversalID=doc.UniversalID
        Call newdoc.Save(True,False)
        &#039;&#039; Start Answer
        &#039; находим все дочерние документы    
        Set dc = doc.Responses    
        
        Set ftdoc = dc.GetFirstDocument    
        While Not ftdoc Is Nothing
            
            Set ftnewdoc=workdb.CreateDocument        
            Call ftdoc.CopyAllItems(ftnewdoc,1)
            ftnewdoc.UniversalID=ftdoc.UniversalID
            Call ftnewdoc.Save(True,False)
            
            Set nextftdoc = dc.GetNextDocument (ftdoc )
            Set ftdoc=nextftdoc
            Set nextftdoc=Nothing
            &#039;Print ftdoc.UniversalID
        Wend    
nextDoc:
        &#039;&#039;End Answer
        Set nextdoc = view.getnextdocument(doc)
        Set doc=nextdoc
        Set nextdoc=Nothing
        Print doc.UniversalID  &amp; doc.header(0)
    Wend
    Exit Sub
Errh:    
    &#039;
    Print Error &amp; | in line | &amp; Erl(), 64, |Lotus Notes (| &amp; Lsi_info(2) &amp; |)|
    Goto nextDoc
    &#039;Exit Sub</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2019-04-22T07:28:49Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124750#p124750</id>
		</entry>
</feed>
