1
10eyro
Здравствуйте. Есть 2 формы А1-Document Поле-Ф1, A2- response Поле-Ф1. Создаю документ в форме А1 сохраняю и из этой формы открываю Форму Ф2, при нажатие кнопки мне нужно скопировать данные из Формы А1-Document Поле-Ф1 в форме A2- response Поле-Ф1.
В форме А1 создал 2 поля MainUNID - text computed формула - @Text(@DocumentUniqueID) и SelfUNID text computed формула - Text(@DocumentUniqueID). В форме respons А2 создал 3 поля MainUNID text computed формула - MainUNID, поле SelfUNID text computed формула - @Text(@DocumentUniqueID) и...
и поле preSelfUNID text computed when composed - SelfUNID. Под кнопкой следующий код:
Но при нажатие кнопки выдает Invalid Universal ID. Помогите, что делаю не так?
В форме А1 создал 2 поля MainUNID - text computed формула - @Text(@DocumentUniqueID) и SelfUNID text computed формула - Text(@DocumentUniqueID). В форме respons А2 создал 3 поля MainUNID text computed формула - MainUNID, поле SelfUNID text computed формула - @Text(@DocumentUniqueID) и...
и поле preSelfUNID text computed when composed - SelfUNID. Под кнопкой следующий код:
Код:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim response As NotesDocument
Dim parent As NotesDocument
Dim ritem As Variant
Dim gettext As String,newtext As String
Dim j As Long,lastmark As Long
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
If uidoc.IsNewDoc Then
Set response = uidoc.Document
predocUNID = response.preSelfUNID(0)
If predocUNID ="" Then
Exit Sub
End If
Set parent = db.GetDocumentByUNID( predocUNID)
Set ritem = parent.GetFirstItem("ПолеФ1") ' поле откуда берем данные
lastmark = 1
newtext = Chr(13) & Chr(10)
gettext = ritem.GetFormattedText(False,256) & Chr(10)
For j=1 To Len(gettext)
c=Mid(gettext,j,1)
If c=Chr$(10) Then
newtext = newtext & "> " & Mid$(gettext, lastmark, j + 1 - lastmark)
j = j + 1
lastmark = j
End If
Next j
Call uidoc.FieldAppendText( "ПолеФ1", newtext ) ' добавляем в новое поле
Call uidoc.GotoField( "Body" )
End If
End Sub
Но при нажатие кнопки выдает Invalid Universal ID. Помогите, что делаю не так?