hanszie
asked on
Adding new fields and labels dynamicly to Form in LotusScript???
Hello,
I have to create a questionaire application using Lotus Notes.
I don't know much about LotusScript and I'm looking for some help!!
I want to put values from a View into new dynamic added fields.
Now the values appeare in a message box.
The code:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim docweg As NotesDocument
Dim doc2 As NotesDocument
Dim dc As NotesDocumentCollection
Dim viewVraag As NotesView
Dim viewAfgekeurd As NotesView
Dim telafgekeurd As Integer
Dim telgoedgekeurd As Integer
Dim stringcijfer As String
Dim cijfer As Integer
Dim nummer As Integer
Dim vraag As String
Set db = session.CurrentDatabase
Set viewVraag = db.GetView("vraagcommentaa roverzicht ")
Set viewAfgekeurd = db.GetView("vraagcommentaa roverzicht ")
Set doc = viewVraag.GetFirstDocument
nummer = -1
While Not(doc Is Nothing)
nummer = nummer +1
telafgekeurd = 0
telgoedgekeurd = 0
vraag = doc.txt_vraagcommentaar(0)
stringcijfer = doc.rb_cijfers(0)
cijfer = stringcijfer
Msgbox vraag
Msgbox cijfer
Set dc = viewAfgekeurd.GetAllDocume ntsByKey(c ijfer)
Set doc2 = dc.GetFirstDocument
While Not(doc2 Is Nothing)
Msgbox cijfer
If doc2.vraagcommentaaroverzi cht(rb_cij fers) = "2" Then
telgoedgekeurd = telgoedgekeurd + 1
Msgbox telgoedgekeurd
Elseif doc2.vraagcommentaaroverzi cht(rb_cij fers) = "3" Then
telafgekeurd = telafgekeurd + 1
Msgbox telafgekeurd
End If
Set doc2 = dc.GetNextDocument(doc2)
Wend
Set docweg = doc
Set doc = viewVraag.GetNextDocument( doc)
If telafgekeurd > telgoedgekeurd Then
Msgbox "Deze vraag mag worden weggegooid"
Call docweg.Remove(True)
End If
nummer = -1
Wend
End Sub
I hope someone can help me...
Greetings Hanszie
I have to create a questionaire application using Lotus Notes.
I don't know much about LotusScript and I'm looking for some help!!
I want to put values from a View into new dynamic added fields.
Now the values appeare in a message box.
The code:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim docweg As NotesDocument
Dim doc2 As NotesDocument
Dim dc As NotesDocumentCollection
Dim viewVraag As NotesView
Dim viewAfgekeurd As NotesView
Dim telafgekeurd As Integer
Dim telgoedgekeurd As Integer
Dim stringcijfer As String
Dim cijfer As Integer
Dim nummer As Integer
Dim vraag As String
Set db = session.CurrentDatabase
Set viewVraag = db.GetView("vraagcommentaa
Set viewAfgekeurd = db.GetView("vraagcommentaa
Set doc = viewVraag.GetFirstDocument
nummer = -1
While Not(doc Is Nothing)
nummer = nummer +1
telafgekeurd = 0
telgoedgekeurd = 0
vraag = doc.txt_vraagcommentaar(0)
stringcijfer = doc.rb_cijfers(0)
cijfer = stringcijfer
Msgbox vraag
Msgbox cijfer
Set dc = viewAfgekeurd.GetAllDocume
Set doc2 = dc.GetFirstDocument
While Not(doc2 Is Nothing)
Msgbox cijfer
If doc2.vraagcommentaaroverzi
telgoedgekeurd = telgoedgekeurd + 1
Msgbox telgoedgekeurd
Elseif doc2.vraagcommentaaroverzi
telafgekeurd = telafgekeurd + 1
Msgbox telafgekeurd
End If
Set doc2 = dc.GetNextDocument(doc2)
Wend
Set docweg = doc
Set doc = viewVraag.GetNextDocument(
If telafgekeurd > telgoedgekeurd Then
Msgbox "Deze vraag mag worden weggegooid"
Call docweg.Remove(True)
End If
nummer = -1
Wend
End Sub
I hope someone can help me...
Greetings Hanszie
ASKER
thanks zvonko,
but "doc.AppendItemValue( FieldName$, FieldValue )" did not work.
I want to put fields on a Form not in a View.
but "doc.AppendItemValue( FieldName$, FieldValue )" did not work.
I want to put fields on a Form not in a View.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bad news with points ? Enjoy!
And hanszie - Zvonko is right.
And hanszie - Zvonko is right.
ASKER
ok thats bat...
does somebody has an other idea for my problem.
does somebody has an other idea for my problem.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
doc.AppendItemValue( FieldName$, FieldValue )
Call doc.RemoveItem( FieldName$ )
Good luck,
Zvonko