Mapping-level default values

Usually, you will establish default values as you design the methods for each business object. However, you might also decide to establish some default values at the data-source mapping level. When you do this, your settings will apply to all methods of all business objects that use that mapping. This can be convenient for establishing very basic defaults that will apply to many methods at once, such as when selecting records to match the current user’s preferred language. These will be overridden by business object method settings if they exist.

Default values can be set for both table mappings and stored-procedure mappings.

Unlike default values established at the business-object level, those made at the mapping level apply directly to specific tables and fields from the data source rather than through the attributes of the business object.

Mapping-level defaults are only used by update and insert methods. They establish default values for attributes for cases where no value has been set by the business object method.

To set mapping-level default values

  1. Go to Data Sources.
  2. Right-click on the data source and select Mappings.
  3. Locate the primary mapping for which you want to establish default values. Right-click on this mapping and select Default Values... from the context menu.

    The Default Values window opens. It shows the current default values, if any, for the mapping you selected.

  4. Click Add.
  5. For each default value, set the following:

    Table

    Select the table from the data source to which the default value applies.

    Field

    Select the name of the field from the selected table to which the default value applies.

    Value

    The default value for the specific field and table. Often, this will be the name of a variable.

  6. Click OK.