Default Value

Why can’t I get a default value in an editable field? I want a value to be automatically filled in using the name of a computed field as the formula, but it doesn’t work. I want a value placeed in their, but the user has the option to change it. Is it possible?

Subject: Default Value

Depends on the form/ field design - where are the fields placed? What is the formula for the computed field and where is it getting its value from? Does it have its value before the form is loaded and the default field values have been computed?

Subject: RE: Default Value

The editable field is after the computed field.

Basically the first field is an editable “client” field, the next field computes the “mileage” based on who the client is (lookup to view), the next field computes a “$ Amount” based on the “mileage” field, and lastly the editable field which I want to default to the “$ Amount”. Can this be done?

Subject: RE: Default Value

No. Default values only apply at the moment of composition. You want a “delayed default” based on user input after the form has been composed. You can compute the value in a form event (and you can sneak it into your computed field’s formula) and directly update that field based on whether or not the field is currently empty.

Subject: RE: Default Value

I’ve tried putting code in the postrecalc event, but I realized I made a mistake with the FieldSetText…how do I make it work for an integer?Sub Postrecalc(Source As Notesuidocument)

Dim location As Integer

location = source.FieldGetText( “FieldValue4” )

Call source.FieldSetText( “FieldValue5”, FieldValue4 )

End Sub

Thanks!

Subject: RE: Default Value

… or do something like add a button to prompt the user to enter a new value for the amount and set the value via code in the UI… not as elegant.