Solved

Clearing all fields on a Form in LotusScript

Posted on 2000-04-25
7
955 Views
Last Modified: 2013-12-18
Is there a command that will clear all the fields on a form?
0
Comment
Question by:roosterup
  • 4
  • 2
7 Comments
 

Expert Comment

by:Scott2000
ID: 2748014
Hi rooster,

Howabout something like:

Forall item In doc.Items
     item.Remove
     doc.Save True, True
End Forall

Regards,

Scott.
0
 
LVL 1

Author Comment

by:roosterup
ID: 2748984
I tried to use the following code, but this didn't work.  Can I clear all the field on my UI document? I'm not sure I understand the relationship between NotesDocument and NotesUiDocument


Dim WS As New notesUIWorkspace
Dim uidoc As NotesUiDocument
Set uidoc = ws.currentdocument

Dim doc As NotesDocument
Set doc = uidoc.Document

Forall item In doc.Items
     item.Remove
End Forall
0
 
LVL 5

Expert Comment

by:snocross
ID: 2749232
Try this in place of the set uidoc you are using:

Set UIDoc = session.DocumentContext
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Accepted Solution

by:
Scott2000 earned 10 total points
ID: 2750310
Hi rooster,

Ok, the NotesDocument can be thought of as the physical representation of the notesuidocument you are viewing on screen.

If you need to clear all fields on the uidocument, it is not so easy.

For hidden fields, you will probably need to remove each value by specifying them by name.

For fields that are editable and assuming the uidocument is in edit mode, you could use uidoc.gotoPrevField and uidoc.gotoNextField to loop through all of the fields.

Can I ask why you need to clear all fields in the uidocument.  It may help us understand the problem better.

Regards,

Scott.
0
 
LVL 1

Author Comment

by:roosterup
ID: 2751697
I am accessing an AS/400 using an ODBC connection to do a lookup on DB/2 files. I'm creating a form for displaying parts, one record at a time, when I want to look at the next part, I need to clear the fields for the current part.

The example I have uses:
"Call uidoc.Fieldsettext" to populate the fields on my form. Is there a better way to do this? Should I be creating a NotesDocument and setting it to Uidoc, then populate the NotesDocument fields?

thanks for your comments so far, i will try it.
0
 

Expert Comment

by:Scott2000
ID: 2751821
If you are creating documents based on result queries and you don't need to see them created on screen, you would be better using the NotesDocument than the NotesUIDocument

If this is the case, here's how to create a notesdocument instead (not included the ODBC conns since you obviously have that already:

Dim doc as NotesDocument
Dim db as NotesDatabase
Dim session as New NotesSession

Set db = session.CurrentDatabase
Set doc = db.CreateDocument

'Here you would have your loop I guess e.g. (While not (rs.eof))
   doc.Form = "FormName"
   doc.FieldName = "Some value from recordset"
   doc.FieldName2  = Some other value"
   doc.Save True, True
'End of the loop (Wend)

If you must use the uidocument to display as you get them, then the previous comments in the last message still apply....

Cheers,

Scott.

p.s. not back in work until Tuesday, so hope this is enough to help
0
 

Expert Comment

by:Scott2000
ID: 2751826
Sorry that should read:


Dim doc as NotesDocument
Dim db as NotesDatabase
Dim session as New NotesSession

Set db = session.CurrentDatabase  

'Here you would have your loop I guess e.g. (While not (rs.eof))
    Set doc = db.CreateDocument
    doc.Form = "FormName"
    doc.FieldName = "Some value from recordset"
    doc.FieldName2  = Some other value"
    doc.Save True, True
'End of the loop (Wend)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now