I have a form and it contians multiple fields. I need to change the default value of these fields from a profile document. I don’t want to make the default value as compute/dblookup while the document load. Instead I would like to change the “default value” of the form(in design itself) using lotusscript or some api. This helps the form to load fast compared to the normal compute method.
Any idea.
Subject: RE: Change default value of a field
Changing the design of a form with a program is tricky. It’s possible to export the whole thing to DXL, tweak the DXL, and save it back. But you might not get back the exact same thing; DXL doesn’t represent everything, especially some newer options.
Otherwise, the C API (and I think C++ API also) can do it, but you need to know a lot.
Midas API from Genii Software might let you do this more easily.
Incidentally, reading default values from a profile document is not that much slower than using hardcoded values. If you have a performance problem with your form and you’re already using profiles instead of @DbLookups, there are other things you might look at before you go to such extremes. Performance basics for developers (whitepaper) is a good place to start.
Subject: Change default value of a field
I would NOT recommend changing the design of a db by script, because the concept of LN is the use of templates and replication.
If you want to omit lookups, why don’t you think of a ‘document template’-Solution → Save a document with the defaults and Users can create copies of it for new documents (eighter remove unwanted fields or copy only needed fields to new doc).
I usually create an script-agent where the document will be created setting default values based (also with user interactions thru dialog lists) and lookup values (usualy a setup or profile document = 1 lookup).