🔥 Бесплатный курс от Академии Кодебай: «Анализ защищенности веб-приложений»
🛡 Научитесь находить и использовать уязвимости веб-приложений.
🧠 Изучите SQLi, XSS, CSRF, IDOR и другие типовые атаки на практике.
🧪 Погрузитесь в реальные лаборатории и взломайте свой первый сайт!
🚀 Подходит новичкам — никаких сложных предварительных знаний не требуется.Доступ открыт прямо сейчас — Записаться бесплатно
Как-то иначе провернуть по сравнению с чем?или можна ето дело както иначе провернуть?
Dim ses As New NotesSession
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument'документ який будем міняти
Dim dcres As NotesDocumentCollection'колекція респонзів основного документу
Dim docres As NotesDocument'респонз основного документу
Dim doctp As NotesDocument'шаблонний документ
Dim doctpres As NotesDocument'респонз шаблонного документу
Dim clone As NotesDocument 'майбутній дитинський документ клієнта
Dim dc As NotesDocumentCollection'колекція документів для зміни
Dim dctp As NotesDocumentCollection'колекція темплейтів
Dim dctpres As NotesDocumentCollection'колекція респонзів до темплейту
Dim db As NotesDatabase
Dim tp As String
Dim tptempl As String
Dim fm As Variant
Dim value As String
Dim v As String
Set db = ses.CurrentDatabase
Set dc = ses.CurrentDatabase.UnprocessedDocuments
If dc.Count >0 Then
Set doc = dc.GetFirstDocument
While Not doc Is Nothing
tp = doc.GetItemValue("CustomerType")(0) ' визначаєм поточний тип клієнта
'діалог вибору, щоб визначити необхідний тип клієнта
Set dctp = ws.PickListCollection( 3, False, db.Server,db.FilePath , "vw-customer-types", "Оберіть необхідний тип документу", "тип документу" )
If dctp.Count > 0 Then
Set doctp = dctp.GetFirstDocument
tptempl = doctp.GetItemValue("Code")(0)
Else
Exit Sub
End If
Call doc.ReplaceItemValue("Code", tptempl)
Set dctpres = doctp.Responses
Set dcres = doc.Responses
If dctpres.Count>0 Then
Set doctpres = dctpres.GetFirstDocument
While doctpres.form(0)="document"
If doctpres.IsMandatory(0)="M" Then
v = doctpres.GetItemValue("DocNo")(0)
Set docres = dcres.GetFirstDocument
While docres.form(0)="document"
value = docres.GetItemValue("DocID")(0)
ss$ = Strrightback(value, ".")
If ss$=v Then
If doctpres.IsMandatory(0)=docres.IsMandatory(0) Then
Else
Call doc.ReplaceItemValue("IsMandatory", doctpres.IsMandatory(0))
End If
Else
Set clone = db.CreateDocument
If Not clone Is Nothing Then
clone.form = doctpres.form(0)
clone.DocName = doctpres.DocName(0)
clone.IsMandatory = doctpres.IsMandatory(0)
clone.DocComment = doctpres.DocComment(0)
clone.form = doctpres.form(0)
Call clone.CopyAllItems(doctpres)
Call clone.RemoveItem("$UpdatedBy")
clone.isClone = "1"
Call clone.ReplaceItemValue ( "DocBranchDate", Evaluate ({ @Now }))
clone.DocVer = 1
clone.DocNo = doc.customerid(0) & "." & doctpres.DocNo(0)
clone.DocID = clone.DocNo(0)
clone.isTemplate = "0"
Call clone.MakeResponse(doc)
Call clone.Save(True, False)
End If
End If
Set docres = dcres.GetNextDocument(docres)
Wend
End If
Set doctpres = dctpres.GetNextDocument(doctpres)
Wend
End If
Wend
End If
Call doc.Save(True, False)
каким образом создать два масива, заполнить их и сравнить дание в них?
както иначе ето не через масив
Set list( ключ, вычисленный на текущем респонсе шаблона) = templateResponse
'ключ = "номер + статус документа"
if iselement( list ( ключ, вычисленный на текущем респонсе документа ) ) then
'... нашли:
docResponse.flag = flagValue ' "п.8: уставливаем флаг (обязательний или необязательний)"
else
'... не нашли
создаем новый: Set clone = ...
валим текущий респонс документа ' "п.9. все ненужние доки удаляем."
end if
:lovecodeby:Т мягкого в Белорусском нету, и не было никогда.. аяйяй. Потому тогда уже Дакумент-бацька"Документ-батько"
я уже давно об этом серьезно говорил!ибо меня уже он подкалывал насчет добавления еще одного языка в правила форума
Dim ses As New NotesSession
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument'документ який будем міняти
Dim dcres As NotesDocumentCollection'колекція респонзів основного документу
Dim docres As NotesDocument'респонз основного документу
Dim doctp As NotesDocument'шаблонний документ
Dim doctpres As NotesDocument'респонз шаблонного документу
Dim clone As NotesDocument 'майбутній дочірній документ клієнта
Dim dc As NotesDocumentCollection'колекція документів для зміни
Dim dctp As NotesDocumentCollection'колекція темплейтів
Dim dctpres As NotesDocumentCollection'колекція респонзів до темплейту
Dim db As NotesDatabase
Dim tp As String
Dim tptempl As String
Dim fm As Variant
Dim value As String
Dim v As String
Dim olddc List As NotesDocument
Dim newdc List As NotesDocument
Dim ListKey As String
Dim ListKeyNext As String
Dim ListKeyOld As String
Dim ListKeyNextOld As String
Set db = ses.CurrentDatabase
Set dc = ses.CurrentDatabase.UnprocessedDocuments
If dc.Count >0 Then
Set doc = dc.GetFirstDocument
tp = doc.GetItemValue("CustomerType")(0)
Set dctp = ws.PickListCollection( 3, False, db.Server,db.FilePath , "vw-customer-types", "Оберіть необхідний тип документу", "тип документу" )
If dctp.Count > 0 Then
Set doctp = dctp.GetFirstDocument
tptempl = doctp.GetItemValue("Code")(0)
Set dctpres = doctp.Responses
If dctpres.Count>0 Then
Set doctpres = dctpres.GetFirstDocument
Do Until doctpres Is Nothing
ListKey = doctpres.IsMandatory(0)
ListKeyNext = doctpres.DocNo(0)
Set newdc( ListKey ) = doctpres
Set newdc( ListKeyNext ) = doctpres
Set doctpres = dctpres.GetNextDocument( doctpres )
Loop
Else
Exit Sub
End If
End If
Set dcres = doc.Responses
Set docres = dcres.GetFirstDocument
Do Until docres Is Nothing
ListKeyOld = docres.IsMandatory(0)
value = docres.GetItemValue("DocID")(0)
ListKeyNextOld = Strrightback(value, ".")
Set olddc( ListKeyOld ) = docres
Set olddc( ListKeyNextOld ) = docres
Set docres = dcres.GetNextDocument( docres )
Loop
End If
имеется два списка... newdc & olddc
Forall a In newdc
docid=Listtag(a) ---- здесь(сначала показивает обязателен ли документ, потом второе значение(номер документа)..
я думал что будет проверять сразу строку.....или я неправильно делаю проверку...
)
If Iselement(olddc(docid)) Then
Else
End If
End If
End Forall
Call doc.ReplaceItemValue("Code", tptempl)
Call doc.Save(True, False)
Do Until doctpres Is Nothing
If doctpres.form(0) = "document" Then
If doctpres.IsMandatory(0)="M" Then
'ListKey = doctpres.IsMandatory(0)
ListKeyNext = doctpres.DocNo(0)
'Set newdc( ListKey ) = doctpres
Set newdc( ListKeyNext ) = doctpres
End If
End If
Set doctpres = dctpres.GetNextDocument( doctpres )
Loop
Forall a In newdc
docid=Listtag(a)
If Iselement(olddc(docid)) Then
здесь хотелось би проставлять флаг - "обязательность" для всех доков...
ну чтоб перестраховатся
но вот как ???? :(
Else
тут создавать новие документи....
Set clone = db.CreateDocument
End If
End Forall
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab