Link to home
Start Free TrialLog in
Avatar of hanszie
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("vraagcommentaaroverzicht")
     Set viewAfgekeurd = db.GetView("vraagcommentaaroverzicht")
     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.GetAllDocumentsByKey(cijfer)
          Set doc2 = dc.GetFirstDocument
          While Not(doc2 Is Nothing)
               Msgbox cijfer
               If doc2.vraagcommentaaroverzicht(rb_cijfers) = "2" Then
                    telgoedgekeurd = telgoedgekeurd + 1
                    Msgbox telgoedgekeurd
               Elseif doc2.vraagcommentaaroverzicht(rb_cijfers) = "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
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Look for this two methods of NotesDocument:

doc.AppendItemValue( FieldName$, FieldValue )

Call doc.RemoveItem( FieldName$ )

Good luck,
Zvonko

Avatar of hanszie
hanszie

ASKER

thanks zvonko,

but "doc.AppendItemValue( FieldName$, FieldValue )" did not work.

I want to put fields on a Form not in a View.
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bad news with points ?  Enjoy!

And hanszie - Zvonko is right.
Avatar of hanszie

ASKER

ok thats bat...

does somebody has an other idea for my problem.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial