0
votes

I would like to edit/read document which is been just saved, below is the code I am putting but it opens view first document on which the LS agent code is being run. this agent runs on Notes client.

Call ReportDoc.Save(1,0)
Call ws.EditDocument(False, ReportDoc, False)

I also tried getting univrsal id and tried but same output.

Please assist.

1
Where is the code (in a button?) and what code gets executed after those two lines?Knut Herrmann
Yes it is in view action button, action button in turn calls agent and agent generates reports and saves it, I need to open the saved document. after this code it is calling exit sub and program gets terminated.hdc
Are you sure, that ReportDoc is NOT the first documebt in view? Please post your code how you get / create the report document as the error must be there not in the code you postedTorsten Link
I am putting like 'set NewReportDoc= new notesdocument(thisdb) Set NewAppRTItem = New NotesRichTextItem(NewReportDoc, "NewApplicationsBody" ) Set RewNewAppRTItem = New NotesRichTextItem(NewReportDoc, "ReassessmentBody" )' here appending contents to RTfield using richtextnevigator and table lastly call NewReportDoc.save(1,0) and call ws.editdocument(false,NewReportDoc,false)hdc
Have you set Form field?Casper Skovgaard

1 Answers

0
votes

Probaly Save() doesn't work. Notes takes the current selected document in view then for EditDocument().

Change your code to:

If ReportDoc.Save(True, False) Then
    Call ws.EditDocument(False, ReportDoc, False)
Else
    MessageBox "Save failed", 48, "Error"
End If