Hi
I have a lotusscript code that creates new field on a document that is in edit mode. The code is in the postrecalc event of the form. Based on a selection of a listfield these new fields are created on the document. I use the method uidoc.FieldSetText
But this method returns an error if the fieldname does not physically exist on the form. In the help nothing is mentioned that the field MUST exist on the form.
How can I create new fields on a document ( through lotusscript) while the document is open in edit mode and not saved yet?
Regards
Subject: Creating new fields on a document.
In the same event, Try setting
Dim doc as notesdocument
Set doc =uidoc.document
call doc.save(,)
then try setting yr fields
doc.Field1
doc.Field2
The field setting could work before this line too
call doc.save(,)
Subject: Creating new fields on a document.
That limitation to uidoc.FieldSetText is inherit because it is a UI method. The method finds a displayed field in the UI and inserts the specified string - if the field doesn’t exist, it certainly can’t work.
If you wish to set an item value for a field that doesn’t exist on the form, you need to use the backend Notesdocument which still exists even on an unsaved. Access it via uiDoc.Document.