To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

View member feedback to this Ask the Expert Q&A.
There is no way in formula language or LotusScript to dynamically add fields to the design of a form.
However, you can easily add fields to any given document with Formula language (from an agent run in a view) or LotusScript. With LotusScript, get a handle to the NotesDocument object in the back end and use the ReplaceItemValue method. Just specify the name of the field to add to the document and it will be added to the document as long as you call doc.Save afterward.
You can loop through all documents in a view or database and add the same field to all documents, but it will not be added to new documents going forward unless you run the agent again.
MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:
You can add fields to documents in formula language in a form field translation event with statements like the following:
FIELD MyNewField := @Modified;
FIELD AnotherField := @If( @day < 32; 42; -1 );
Mark B.
******************************************
Fields can be created using ReplaceItemValue as well by directly assigning some value to the new field one wants to create. Example,the following scriptlet will add a field "Title" to the document:
doc.Title = "Newly added field"
Of course, you need to save the changes.
Arun A.
Do you have comments on this Ask the Expert question and response? Let us know.
|