RichText field in new doc does not keep value

I try to display dummy document with one Text field and one RichText field using workspace.dialogbox.

Both fields are on the form.

But RTFIELD displayed as blank while TFIELD displayed OK.

Following is the code:

Begin:

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession

Dim db As NotesDatabase

Dim tempdoc As NotesDocument

Dim RTFIELD As NotesRichTextItem

Set db = session.CurrentDatabase

Set tempdoc = db.CreateDocument

tempdoc.form = “TESTForm”

Set RTFIELD = New NotesRichTextItem(tempdoc, “RTFIELD”)

Call RTFIELD.AppendText( “Rich Text Value” )

tempdoc.TFIELD = “Text field value”

Call workspace.DialogBox _

(“TESTForm”, True, True, False, False, False, _

False, “Title.”, tempdoc)

:End

Avantually, I am planning to insert into RTFIELD couple of docLinks do different db.docs(I also would appriciate comments on that).

Thanks

Subject: DocLink does not work

Thank you, I got that.

But final thing still does not work:

Dummy form shows Bill Of Materials(Tree of what product consists of).

We keep real data on AS400.

Before displaying Dummy form I call AS400 program and get data thru ODBC. Then I create and show data in text field.

They still not happy. They want to be able to click on any of the products and see more details.

I planned to place docLink next to each product.

But I could not find the way for docLink to work from dialogbox.

I, really do not know what to do next…

Any ideas?

Thanks

Subject: RE: DocLink does not work

you’re going to have to create the richtextitem in a new document BEFORE trying to display it to the user in a dialogue, doing this on the fly will not work without closing and reopening the document

Subject: It will, the document just has to be SAVED first.

i.e.Call tempdoc.Save(True, False)

ret = workspace.DialogBox(…)

Subject: RichText field in new doc does not keep value…

I think you will need to save, close and ropen the document to see your changes in the rich text field.

Subject: RE: RichText field in new doc does not keep value…

you want to do something like this…

if UIDoc.EditMode then

Call UIdoc.refresh

Call UIDoc.Save()

else

curdoc.save

end if

strDocID = curDoc.NoteID

Call uidoc.Close

If Not CurDoc Is Nothing Then Delete curDoc

If Not UIDoc Is Nothing Then Delete uidoc

If Not ws Is Nothing Then Delete ws

Set curDoc = db.GetDocumentByID( strDocID )

Set WS = New NotesUIWorkspace

Call WS.EditDocument(True,curDoc)