A few words about the underlying application:
-
its old, 10 years old this year in fact
-
it still has some R4 features but currently runs in R6.5.4
-
its overdue for some reengineering, but no money available
-
it deals with medical info
The users attach lots of things to a particular field, e.g. a report of why that pacemaker blew up & the consequences to the patient (usually death). Once the field exceeds a certain size Notes very helpfully creates another field of the same name, and puts the next few attachments into that. You can (& we have) end up with 5 or more fields all with the same name. When you look at the document thru the Notes client it looks ok, as in all the rich text fields appear as if one.
My problem is that I need to do stuff with the rich text field using LotusScript. Using Notesdocument.getfirstitem(richtextfieldname) will bring back the last of the rich text fields of that name. Anyone got any ideas how to get at the others of the same name?
Ta
Sue
Subject: Multiple Rich Text fields
You could loop through the items in a NotesDocument and check for the richtextfieldname?Or you could use the GetFirstItem method and remove the item after processing it. NOTE : Changes will be made final after a save, so don’t save the document!! If the document needs to be saved try making a copy of the document, and use the copy to remove items.
Subject: RE: Multiple Rich Text fields
Hmm, nice to know us Notes types think along the same lines. Unfortunately been there tried that.
Getfirstitem & remove had the effect of deleting all the fields with that name - exactly what I didn’t want.
Looping through the items. Now it was a while ago that I tried this & am trying to remember what happened. I have a feeling that you still only got one hit for the fieldname, so still only ‘saw’ part of the whole thing. Obviously Notes itself does something really clever behind the scenes to link together these duplicate fields.
Thanks for the thoughts.
Sue
Subject: RE: Multiple Rich Text fields
What version of Notes are you using? 7.0.2 seems to have a bug getting a handle on multiple NotesItems with the same name.
Try it with 6.5.5
Subject: version used
Domino 6.5.5Notes 6.5.4
(although in fairness I have the 7.0.1 client installed on the laptop & get the same in that).
Subject: Multiple Rich Text fields
This is usually automatic. Notes has a max item size of 64k; so it creates multiple items automatically and increases the “Dup Item ID” as required. You can check this in the property inspector (Alt-Enter).
Your attachments will be stored in separate $FILE descriptors which point to the external storage for the docs (external means not on the document; the attachments are stored as blobs in the database).
What problems do you encounter that you are convinced that you get only the last item?
P.
Subject: RE: Multiple Rich Text fields
My rich text field has attachments in it, many of them. But the rich text item I get when I getfirstitem has none in the embeddedobjects array. The document has many rich text fields, and each can have attachments so I can’t loop through $Files.
Another problem I had was using RichTextNavigators to navigate to the end of a table and then inserting a new row and populating it. Sometimes this worked & sometimes not. I’m now fairly certain this was because I wasn’t in the rich text field I thought I was (have already reengineered this one).