"Document has invalid format" on save

I am struggling to find a fix for this. Can anyone see any Notes limits I might have overstepped?

There is a document in a database which has started to give this error when I try to save any change to it. Other documents in the database cause no error.

I realise the simple solution is delete the document, unfortunately it’s a “control document” rather than a “user content” one. I can’t remove it without breaking the design. Details of the document;

891 fields (yes I know. I inherited this design. Sigh)

Of these, 131 are summary fields

The total size of all fields (from NotesItem.ValueLength) is 87677 bytes

The total size of all the summary fields is 9673 bytes. I think the Notes limit on this figure is 64000

The biggest single field is 23165 bytes. I think the Notes limit on this figure is 64000

There are no rich text fields and no attachments

So far I have tried;

  1. Truncating some fields to reduce their size. I still get an error when I try to save any change

  2. Creating a new document by copying the items one by one, using NotesItem.CopyItemToDocument(). I get an error when I try to save the new document.

  3. Creating a replica of the database, running fixup and compacting it. I still get the error.

Any suggestions would be welcome. I have Notes 6.5.4 client running on Windows XP. Best wishes, Ian

Subject: “Document has invalid format” on save

a) Can you save without changes?

b) You could see if a single individual field is causing the problem by creating (and deleting) new documents with just one item from the original one.

c) You could use NotesDXLExporter and DXLImporter to re-create the document

Subject: RE: “Document has invalid format” on save

Thanks Rob,

I had not thought of using the DXL Export/Import methods. Here’s what I did try;

I made a LotusScript agent which created a blank new document, then copied the fields from the old corrupt document one by one. It did this by;

set itemNew = New NotesItem( docNew, itemOld.Name, itemOld.Values )

itemNew.IsAuthors = itemOld.IsAuthors

itemNew.IsSummary = itemOld.IsSummary

etc.

I thought this would be less likely to carry over corruptions than

itemOld.CopyItemToDocument( docNew, “” )

When the agent saved this new document by docNew.Save(), there was no error.

When I opened the new document in the application and made any change, and tried to save it, once again I got the error “document has invalid format”.

I think I will get an uncorrupted version of the document from a backup, and paste it back into the live database, and hope that the errors do not recur.

Best wishes, Ian