Short version: How do I remove summary flags from CfD fields before saving the document?
Detail: I have a form in which I want to generate, using passthru HTML, a formatted version of a data set for viewing only. It is generated on the fly by Queryopen and written to Computed for Display fields, so that it will in any case never be saved.
The total size of the HTML is about 80K. I anticipated that it would be in excess of the 32K limit, so am breaking it up into a series of CfD fields, each of which is well under that limit. The limit I am hitting, I think, is the 64K limit on summary fields for the document as a whole, so I have a function that sets the summary flag to each of those fields to false. I run it in Querysave, and confirm that at the end of Querysave the flag for all of them is still false. Immediately after, though, I get the error "Field is too large..." error, and sure enough on examining document properties the summary flag has been set back (field flags show as SUMMARY).
How do I get this to stick so that I can save the document?
Hi Andrew Brew,
Good Day!
We would like to inform you that you can use "Issummary" property from the Notes Item class.
We would request you to refer the following product documentation for additional information.
Title: IsSummary (NotesItem - LotusScript®)
URL -->https://help.hcl-software.com/dom_designer/14.5.0/basic/H_ISSUMMARY_PROPERTY.html
We would request you to refer the following technical document regarding the 32K field error.
Title: HCL Notes field value error: Field is too large (32K) or View's column & selection formulas are too large
URL --> https://support.hcl-software.com/csm?id=kb_article&sysparm_article=KB0080493
If you are using the Notes client and Domino above 12.0.2 and you can use the load compact -LargeSummary command on the impacted document database to get the ODS to 55, allowing more summary data per field.
We would request you to refer the following document on ODS 55 can be found here: https://help.hcl-software.com/domino/12.0.2/admin/ods_55_introduced_in_domino_12.html
We hope the above information is useful to solve your issue.
Thank you,
Regards.,
Sridhar
Thank you, Sridhar, but what you recommend is precisely what I have already done - setting the IsSummary flag for each item in turn to False. That works, but the moment the routine ends the flags are set back to True, causing the save to fail.
Since the field is of type "Computed for Display" I assume that the changes are being made to value of this field via a handle to notesDocument object obtained from notesuidocument (source) object of queryopen event. making changes using source.fieldsettext will not work in query open in any case.
Now since you do not want to save the changes to the CFD Fields (they could have been editable/computed too as it wont make a difference), why do you need to set / unset the summary flag. Wont setting the value of these cfd field to "" in query save serve the same purpose.
Im not aware of your use case, so im really not sure if my understanding is correct. pardon me if Im off the mark here.
PS: I had the issue about the size of text fields in some other context. allowing large text fields to 64 K via relevant compact option also did not help as my use case required to store data in the range of MBs. I still needed to process the data as text (actually vector data in context of display in Xpages). I resorted to a rich text field instead. See if you can find a way to use rtfield instead. Pass through HTML etc will possibly work just the same for rt field also.
Also have a look at designer help by typing pass through html. There is an item covering this use case. it mentions the use of a field HTML of the type text or richtext depending on the data being < or > 15 k to have the same effect as pass through html for display purposes. Im attaching the help entry for this one. See if it helps.
Regards
help entry.pdf
You are correct that the HTML is written to a notesDocument object derived from the Source in QueryOpen.
As for CfD making this superfluous, I wish it were so but apparently the 64K limit on total summary data includes, to my dismay, CfD fields that are not going to be saved - hence my need to set the summary flags so that they will be ignored on two grounds.
The point of the exercise is to avoid Rich Text (currently the data is being stored as RT in several format, which is slow to compute and wasteful of storage space). I suppose I may be able to write to a temporary RT field that I then delete in PostSave. I will investigate that possibility.
basically I had a similar use case as mentioned above. I used an rtfield and then used the value as text using rtfield.getunformattedtext. using the richtext related classes like richtextnavigator is slow. but getunformatted text is faster.
Now if the text returned by getunformatted text is too large you again get into size issues trying to use array etc in lotus script (in case your logic requires you to process each line in returned text via some loop). I circumvented this issue by using java script instead by converting the data to an array using split on the text with new line as the split separator. Im handling data in excess of 10MB using this approach.
But setting the cfd fields to "" in query save rather than unsetting the summary flag. Doesnt this work in your case??
I hope you are not saving the changes made to cfd fields in query open. This wont be required as the changes made to fields via doc object in query open will still reflect in the ui. so if no save occurs nothing gets saved. if the save occures, set the cfd fields to "" in query save event
using an rt field in your case may still pose some challenges as the content of rtfield will not showup unless the document is saved. Im not sure if rtitem.update will help mitigate the issue but you can try.
Basically, in queryopen changes made to doc object derived from uidocument will reflect in ui even without the doc.save so there is never a need to save the cfd fields in your use case, i guess.
No, there is never a need to save them (so I'm not), but the document counts them in its SUMMARY total all the same, and errors accordingly.
Interestingly, i created three computedfordisplay fields cfd1 cfd2 cfd3 on a form. I used the following script in query open to populate the three fields with 30k data each. the three fields have a SUMMARY Flag set. the system did not throw any error. It throws error only if an indvl field exceeds 32/64k depending upon the configuration of the database.
So the total summary fields size may not be an issue. either one of the fields is exceeding 32 k or eventually when you try to use the combined value from the multiple cfd fields, it exceeds the 32 k limit.
Just check with the script below: (in queryopen, no save, cfd field can have any other value in the form)
Dim doc As Notesdocument
Set doc=source.Document
x="This is a very long line and a very very long line This is a very long line and a very very long line"
For j=1 To 3
y=""
For i=0 To 300
y=y+x
Next
Select Case j
Case 1
doc.cfd1=y
Case 2
doc.cfd2=y
Case 3
doc.cfd3=y
End Select
Next
In doc properties all fields are SUMMARY and size of each field is motre than 30 k.
change 300 to 400 and you start hitting the 32 k limit error
I havent checked with a multi value field though
Rajneesh
I now realise I did not read your answer carefully enough. The final value is actually displayed as Computed Text, which of course is not refreshed after the document is opened. It in turn is based on the CfD fields. Once the computed text has its value set you are quite right that emptying the CfD fields achieves what I am after, for the summary data is no longer there.
Hi Andrew, nice to know your issue is sorted out. Did you try creating the three cfd fields as given in above script. It seems there is no limit on the summary data on per document basis since atleast V12.
Regards. Have a nice day.
I have not tried using your script, but perhaps I will (or something like it) as an experiment. With your line length of 101 characters and a multiplier of 300 the final length of each field will be 30300, which is still < 32K. With three of them I would expect you to hit the error, though, unless your database has large summary already enabled.
Each of my fields is < 32K, but the total is >64K. I did do a compact as recommended above by @Sridhar Reddy Patlolla to increase the allowed summary data in the document, but it did not help. Is there a way, I wonder, to see on a given database whether it allows large summary or not? There is still a limit, I understand, but it is much larger.
Prior to Domino 9.0.1 FP8, the allowed combined size of the summary data for these fields in a document was 64 K. This limit is now 16 MB. The size limit for a field is 64 K for databases at ODS 53 and lower levels and 16 MB for databases at ODS 55.
Procedure Issue the following compact command on a server to enable the increased document summary data limit on a specific database:
load compact -LargeSummary on database.nsf
(on is part of the command)
you will get a specific msg on the console regarding large summary enabled if it succeeds else not.
To check the status of databases with large summary..
Show dir on server console will list all databases..
Last column : on or off indicates largesummary status.
Works on V12 and above.
Show dir dirname/ also works. There doesnt seem to be any command to check a single database..
Regards
Dear Andrew can you try to use the Xpages.
If you don't want to use, I recommend use a rich text field and edition, and you put a field saveoptions that his value 0 to avoid save.
Remember HTML5 in a form not works but in Xpages yes.
Yours sincerely, Roger.
I cannot use XPages - this is in the context of an existing (and rather complex) document. Not saving the document is likewise not an option.
use a rich text field is the unique solution. Remember HTML 5 not works.
Another solution is creating an attach document that is in HTML and you open the URL of the attach.
Yours sincerely, Roger...