Exception occurred calling method NotesXspDocument.getDocument(boolean) null

Hi

I have an Xpage with fileupload and filedownload controls. I tried to submit/save a document with a couple attachments. It works fine. After saving the document, i have tried to delete all attachments and saved the document but it has given me the following error.

Error while executing JavaScript action expression

Script interpreter error, line=3, col=49: [TypeError] Exception occurred calling method NotesXspDocument.getDocument(boolean) null

my code:


1: print(1);

2: print(typeof testDoc.getDocument());

3: var doc:NotesDocument = testDoc.getDocument(true);

4: print(2);

5:

6: //var objDoc= new com.test.DocDocument(doc);

7: doc.computeWithForm(false, false);

8: testDoc.save();

9: //objDoc.testSave();

10: if (!testDoc.isNewNote()){

11: context.redirectToPage(“./test.xsp?documentId=”+doc.getUniversalID()+“&action=editDocument”);

12: }

I would appreciate if anyone helps me on this.

Regards,

Karthik KS

Subject: Same here

getDocument() works, but gives stale valuesgetDocument(true) barfs, always

It might be because the datasource is passed several times as a parameter (my code is in a sub-sub-sub-sub custom control.