|Professional Services||Second Signal||Presentations||Andrew's Blog||Support|
I don't do "Show and Tell Thursday" all that often. I'm just too heads down right now. Today though, I thought I'd share a tip after having to resolve some customer issues related to a problem that can crop up in newer versions of the Notes client.
Background - What is "Summary" data?
When you save a Notes document, it cannot have more than 32k of "Summary" data on it. Summary data is all the values stored from all the fields on your forms that aren't rich text. It also includes any noteitems written to your document that don't have fields defined on the form. This includes the "Form" item, and anything you write with lotusscript, java, or even formula language using the "field itemname := " syntax. In order to be used in a view, data must be "summary" data on the document.
The Problem -
I have this form which is used to kick off a search in NCT Compliance Search. It builds a list of databases which are to be searched very deeply for all documents related to keyword. That's not like just doing a full text search and getting the top results. In this case, there may be thousands of databases and hundreds of thousands of documents to return. Compliance search writes the results to a database as a background process. Its mostly used for complying with legal requests for records.
The list of databases can be thousands of entries long. In some customer cases, its way too long to be stored as summary text. At save, I store the list as a comma delimited string in a hidden rich text field. That works fine and is easily parsed by the background java agent into an array. Its very quick. The problem is, I want to update in real-time a list on the form of the selected databases. Rich text is not good for that. The form has buttons and things that let you use file masks and wildcards to pick the databases to be searched, so its important that you be able to see the list before you submit the search.
Prior to version 6.5.4 and 7.0.1, I was able to write the data to a set of fields, taking care that none were greater than 16k, and display the values of those fields on the form. The data probably wasn't stored correctly on the document at save time, but it wasn't used anyway. Starting in these new versions, however, an error was raised complete with an unavoidable dialog box.
To try to solve the problem, I wrote a loop in the queryRecalc() event to set all those fields to 'non-summary' but that didn't help.
The Solution -
It turns out that even setting the values to non-summary didn't help because at recalc and save time, the field definitions override what you set in the scripted events, and they go back to summary fields. To get around the issue, when I write the list data out I write it to fields which have no prototype field definition on the form. Fieldvalue_1 -> Fieldvalue_N. As I create these items on the note, I set them to non-summary (notesItem.issummary=false). On the form itself, I have field prototypes set as "ComputedForDisplay" which are named differently, but show the values of the actual note items. Since the field prototypes are computed for display, their data is never saved, and thus never made summary or counted.
To clean up, in the querySave() even I have a loop which removes the noteitems I created as fieldvalue_1 -> fieldvalue_N since they are no longer needed.
Please wait while your document is saved.