replaceItemValue query

I have been through the forum and cannot find a definitive answer to the following problem.

While doing a proof of concept on an upgrade from 5.1.12 to 6.5, code that was working under 5.0.12 now fails to run on 6.5. This is the code:

Dim ExposuresField As notesRichTextItem

Set ExposuresField = New NotesRichTextItem( currentPage , “ExposuresTable” )

Set ExposuresField = currentPage.replaceItemValue( “ExposuresTable”,“” )

…

Call ExposuresField.AppendText(|[|+eHTML+|]|)

With this code in, the ExposuuresField does not get populated. However, if I comment out the line

Set ExposuresField = currentPage.replaceItemValue( “ExposuresTable”,“” )

it works!!

Now we had this line in to ensure the field exists on the currentpage, and think that it may still be required in certain circumstances, so what I need to know is:-

Has this been replaced with a new Method?

Will AppendText work if the field is not present?

Am I missing something in Domino 6.5?

Any help would be appreciated!

Subject: replaceItemValue query

From the 6.5 Help: “Replaces all items of the specified name with one new item, which is assigned the specified value.”

So ReplaceItemValue gives you a NotesItem, and AppendText won’t work with that object.

I would expect the code to not compile since ExposuresField is defined as NotesRichTextItem, but its probably because NotesRichTextItem inherits from NotesItem?

As a workaround, perhaps you can move the field ExposuresTable to a place on the form that is pass-through html (assuming amongst others you use a form to display the html).

Subject: RE: replaceItemValue query

Herbert,

Thanks for that.

I knew what is was designed to do, but the strange thing is that this code works perfectly well under 5.0.13.

I thought it was a bug in 6.5, but it’s obviously a “fix”. Is it too late to report a bug for 5.0.13??

Thanks again!