Skip to content

Field Defaults

The Field_Defaults event is provided to support the setting of default values after a clear. You may set any field value, which will be reflected in the DEOs and will get saved with the new record.

Because the setting of defaults is coded in a procedure, it allows for complex rules.

The setting of a default is not recognized as a data change by the Data Dictionary; therefore, the setting of defaults will not generate a "data-loss" warning message.

Procedure Field_Defaults
    Forward Send Field_Defaults
    Set Field_Changed_Value field Customer.State   to "FL"
    Set Field_Changed_Value field Customer.Discount to (Discount(self))
    Set Field_Changed_Value field Customer.City     to "Miami"
End_Procedure

Defaults may also be set upon entry of a DEO by creating a Field Entry method and setting it with the Field_Entry_msg property. That method could set the default value using the Field_Default_Value message.

See Also