Lotusscript - Refresh documents

Hi,

I am facing with the following issue:

I have an Agent that runs on a Server. The Agent reads fields from documents form one DB and creates documents with fields in another DB. Fields include Text and RichText fields.

The problem is on the RichText fields. I am using AppendRTItem to create a field that contains multiple RichText fields from the first DB. After the copy is done I can see in the client the RichText field and everything looks ok. However if I export the data to XML, the formatting I see in the XML is different from what I see in the client. Now, if I open the document in the client, save it and run the XML Export again, everything looks nice in the XML.

I tested also the following: After the copy is done I run a @Command([ToolsRefreshSelectedDocs]) and then I run the Export to XML. Everything looks great.

So the issue that I am facing is that in order to fix my problem I need to open and save the doc first in client and then run my XML export. However since the agent will run on a server (scheduled nightly agent) this is not possible. The same with @Command([ToolsRefreshSelectedDocs]). I can not run it on the server.

I also try ComputeWithForm with no luck.

Any other Idea? I was also thinking to try the C API (I don’t know if there is something in there that can help solve my problem). Anyone know if I can do this with the C API?

Thanks

Subject: Lotusscript - Refresh documents

It sounds to me like it may be a view indices problem (since it fixes the problem just by opening and saving the first doc in the view(which forces a refresh)). Not sure if this will work (actually I think it won’t) but what about calling a refresh on the view.

Call notesView.Refresh

Worth a try. I am not aware of a programatic way to call updall on a view but if there is,that would do it - I think.

Or, what about using the evaulate function in LS with the refreshalldocs command?

Subject: RE: Lotusscript - Refresh documents

Bryan,

thanks for the reply. Actually it does not solve the problem if I open and save the FIRST document in the view. I need to open and save the Document I want to export. So basically I need to open and save all the documents in the view as I need to export all of them.

One thing I noticed is that before I open and save the document, when I look at the document properties in the tab that displays the fields, the RichText field is divided into small pieces all with the same name. After I save the document, there is only one Richtext filed. Maybe this is the problem (maybe not). If I could find a way to force domino NOT to use multiple pieces for a Rich text field may be I could solve my problem… Anyone?

Subject: RE: Lotusscript - Refresh documents

I was able to get the Richtext field to be just one field (by create a tempfiled append the contents of the first Richtext and then copy it back).

However this didn’t solve the problem…

Subject: RE: Lotusscript - Refresh documents

You can also use the call rtitem.compact() - it will also remove any leading or trailing white spaces. They sometimes appear for some reason.