Question if 2 new fields should be hard coded in lotusscript

Hi

I have made changes in an existing application. One of the changes are new fields on a form.

An agent(lotusscript) is running each hour and imports data from a sql database and creates document with the form.

My question is: Do I have to fill these 2 fields with data ( in lotusscript) in order to make sure that these new fields are created with the documents when the agent runs?

Or is this a stupid question?

Regards

Subject: Question if 2 new fields should be hard coded in lotusscript

Not stupid - yes you do. Or alternatively you can use computewithform, but this is quite an expensive operation so if it’s easy just to set the fields to blank do that instead.

Subject: RE: Question if 2 new fields should be hard coded in lotusscript

HI

Thank you for responding.

But what about the other ‘old’ fields on the form. WHy do I have to hard code the 2 new fields in script and not also the other fields?

Subject: RE: Question if 2 new fields should be hard coded in lotusscript

You really only need to add data “where it makes sense” in your application. Usually, you can tell which fields should be filled in if they have any validation formulas. As Dan suggested, a ComputeWithForm would trigger any default values, translation formulas and validation formulas but this is expensive to do and not required since you (the developer) have control of the document creation process rather than the user, whose input typically needs to be validated.

So, have a look at the form, determine whether by not setting any fields, the new document would be left in an inconsistent state with your application, and populate those fields accordingly.

Subject: RE: Question if 2 new fields should be hard coded in lotusscript

Hi

The 2 field just have a default of “No” and no validation of what so ever.

Does it make any difference when a document is created manually by the user or automatically by an automatic agent?

Subject: RE: Question if 2 new fields should be hard coded in lotusscript

If the value of the fields does not depend on the value(s) of any other fields, then I would just assign them the default of “No”. If you do not do this, the document will be created without those values. The moment the document is opened in the User Interface, if the field does not exist then it will receive the default value specified in the form (and if saved, the value that was in the field will now be saved to the document). However, if nobody edits the document again, those fields will be nonexistent and if the field is a radio button (by the sounds of it, perhaps it is), then it should have some kind of value or else other processes may bomb if they expect to see a value in that field.

Recall that there is a back-end version of the document (which you are creating with your agent) and a front-end (which is displayed through the form).