<?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=1106&amp;type=atom" />
	<updated>2021-09-20T07:39:02Z</updated>
	<generator>PunBB</generator>
	<id>https://itpmr.ru/viewtopic.php?id=1106</id>
		<entry>
			<title type="html"><![CDATA[Проверка на повторение регистрационного номера документа.]]></title>
			<link rel="alternate" href="https://itpmr.ru/viewtopic.php?pid=124814#p124814" />
			<content type="html"><![CDATA[<p>Есть такая задача - канцелярии нужно перед регистрацией увидеть, был ли уже&nbsp; в текущем месяце зарегистрирован документ с таким же номером?<br />Решение данной задачи сейчас такое:<br />1. Создается вид &quot;Rnom&quot; - последние регномера, категоризированный по полю &quot;fullregnom&quot; с формулой отбора:<br />SELECT ((Form = &quot;incoming&quot;) | (Form = &quot;inside&quot;) | (Form = &quot;outgoing&quot;))&nbsp; &nbsp;&amp; datereg&gt;@Adjust(@Today; 0; 0; -30; 0; 0; 0)</p><br /><p>2. В кнопке &quot;Зарегистрировать&quot; добавлен код до сохранения файла регнастроек:<br /></p><div class="codebox"><pre><code>    Dim view2 As NotesView
    Set view2 = db.GetView (&quot;Rnom&quot; )
    Dim rdoc As NotesDocument
    Key$ =     doc.doctype(0) + &quot;/&quot; + doc.regnom(0)
    Print &quot;поиск &quot;  Key$ 
    Set rdoc=view2.GetDocumentByKey(Key$)
    If Not rdoc   Is Nothing Then
        Print &quot;найден дубль&quot;
    &#039;    If Left$ (doc.datereg(0),10)  = Left$(rdoc.datereg(0),10) Then
        If ws.Prompt (PROMPT_YESNO, &quot;Продолжить регистрацию?&quot;,     &quot;Документ с №&quot; +  Key$  + &quot;  от  &quot;  + Left$ (rdoc.datereg(0),10)   + &quot;  уже был зарегистрирован!&quot;) &lt;&gt; 1 Then Exit Sub
    &#039;    End If
    End If</code></pre></div>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://itpmr.ru/profile.php?id=2</uri>
			</author>
			<updated>2021-09-20T07:39:02Z</updated>
			<id>https://itpmr.ru/viewtopic.php?pid=124814#p124814</id>
		</entry>
</feed>
