How to define Default Values, and a Prefix for Auto Numbers

From within the Form Designer, you open the Defaults page.
This Defaults page contains ALL the Default Values which apply to the current Business Process.

Sources for Default Values

There are three different "Sources" to default a field:

  • Constants, which can be split into
    • System Constants (for example NOW or TODAY)
    • Client Specific Constants
      These Constants need to be defined before they can be used as Defaults (for example: MaxOrderValue)
  • Profile Values
    Profile Values need to be defined before they can be used as Defaults (for example: User Name)
  • and Fixed Values.

Which to use will depend on your intentions, as well as on the availability of the source for specific field types.

Defaulting a Field

To define a default for a field

  • Click on Add Default
  • Select the Field you want to default.
  • The selections available for the WITH field, and the corresponding VALUE field, are dynamically calculated, i.e. they depend on your previous selections.

To default a field to ...

default it WITH...

Available for the following Field Types.

A dynamic value,
which is in relation to

  • your current system environment.
    For example: Current Time, Current Date.
  • system wide User Constants

Constant

  • Date
  • Time
  • Component
  • Integer
  • Decimal
    (you will need to define this Constant as a type of "Double")

A dynamic value,
which is related to the logged in User

For example: Name of User, Department of User

Profile Value

Available for ALL Field Types, EXCEPT:

  • DB File Fields
  • Subforms

A static, hard-coded value, which will be the same for EVERY record which is created.

Fixed Value

  • Number
  • Lookup
  • Matrix
  • Text/Memo

Prefixing or Padding of Auto Numbers

An Auto Number is a field, where the number in the field will increase with each record. They are used to identify individual records, for example Action Number, or Incident Number.

  • I want to apply a Form Specific Prefix

    The Prefix for Auto Number Fields is already defined in the Component Management. This prefix is used in every form of the application.

    However, it you intend to override this value, or if you need to have different prefixes for various forms, you can use the Default Value functionality to do so.

  • I want to apply Padding to Auto Numbers

    If you want to make sure that an Auto Number has a minimum number of digits, then you will need to apply padding. Padding Auto Numbers will ensure that they can be sorted correctly, and that they have a uniform appearance.

    For example:
    - Unpadded Action Number: ACT-27, ACT-270, ACT-2700
    - Padded Action Number: ACT-000027, ACT-000270, ACT-002700

    The format to define the Default Value of the above example is: ACT-%06d.
    The elements are as follows:

    • ACT- : the Prefix
    • %0: defines the character which is used for the padding. In this example the digit '0' is used for padding
    • 6: defines that the minimum length of the resulting number. Here it is 6 digits.
    • d: necessary to 'delimit' this function string.

To default an Auto Number field to ...

default it WITH...

and type

a form-specific Prefix without Padding

Auto Prefix

The required prefix.

For example: ACT-

a form-specific Prefix with Padding

Auto Prefix

The required prefix, plus the code which will determine the format for the padding:

For example: ACT--%06d

See Also

Default Values