Home > Ask the Domino Experts > Domino Designer Questions & Answers > Dynamically create fields in Lotus Notes
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Dynamically create fields in Lotus Notes

Brad Balassaitis EXPERT RESPONSE FROM: Brad Balassaitis

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 01 April 2005
How do I create fields dynamically in Lotus Notes?

>

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.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino Designer
Resolve Notes 8 migration error: 'Database has not been opened yet'
Lotus Notes access error: 'database is not opened yet'
Stop response documents from showing in a Lotus Notes form
Set a value in a field existing in another Lotus Notes database
Create an automatic scheduled view export in Excel
Display Lotus Notes fields as separate entries in one column
Creating custom Lotus Notes Domino login forms
Using LotusScript to retrieve names of fields on a Lotus Notes form
Importing data from Microsoft Excel to a Lotus Notes form
Error creating product object

LotusScript
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

Lotus Notes Domino Application Development
Create a dynamic user-driven navigator for a Notes/Domino application
Top 10 Lotus Notes/Domino coding and development tips of 2008
Lotus Notes Domino application development best practices
Mimic Lotus Notes Domino application functionality on the Web
Top 10 issues when developing Lotus Notes Domino Internet applications
Top 10 Lotus Notes Domino programming and development tips of 2007
Export Lotus Notes documents to Microsoft Word via Internet Explorer
A bevy of Notes/Domino development tips
How to protect your Lotus Notes application design
Adding an action to the Lotus Notes right-click menu

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts