Under 5.0.12, it is possible to create a text field that is totally unusable in the client. For example:
Set db = session.CurrentDatabase a = "Abcdefghijklmnopqrstuvwxyz " For i = 1 To 7 a = a & a & a Next Print Len(a) ' Result is 59,049-byte string Set doc = db.CreateDocument doc.Form = "CBT" doc.Demo = a Print Len(doc.Demo(0)) ' Result is a 32000-byte string Call doc.Save(True, False)The form can have just one field (demo). If you try to open this document, you get "Field is too large (32 KB)" or "View's column and selection formulas are too large." You can't even do a Document Properties on this document (same error).
Obviously, this is just a demonstration record but it's just to show that it's possible to create inaccessible documents in Notes.
I guess the question is: Is there an easy solution when we encounter something like this? I guess if you always knew the name of the field, it would be possible to write LotusScript that took the text field and rewrote it as a Rich Text field, but then it still wouldn't be useful in the form and you'd have to change all of your agents to process Rich Text instead of text.
I suppose the larger question is: Why are you allowed to create invalid documents in LotusScript? R6.0.1 works about the same, except you get the error message as the document is created but it still creates it.
I will certainly suggest to the person who does the LotusScript class support that an error be raised on the assignment of a to doc.Demo. That would prevent the problem entirely.
Until we fix the class, defensive code within your own application would also prevent the issue. As for dealing with documents already created with this problem, another solution would be to split the field into multiple text fields, and having an agent go through and do the work to truncate the data out of it and create fields (names appended with 1, 2, 3, etc.) with the overflow text. If your agent just iterated through all the fields in the document, you would avoid having to do the name.
Dig Deeper on Domino Resources - Part 4
Related Q&A from Maureen Leland
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.