Using a Serial Number as a Default Value

This example shows how to use a serial number to create a default value for a part number variable.

To use a serial number as a default value:

  1. In the Administration tool, right-click Serial Numbers and select New Serial Number.
  2. In the Serial Number Editor:
    1. For Name, type PartNumber.
    2. For Type, select Serial number from string.
    3. For Format string, type any static text, such as PN, and select a counter value.
    4. Click OK.
  3. Double-click Cards.
  4. In the Card Editor, select Edit > Variables.
  5. In the Edit Variables dialog box, under Selected variable, type the variable name Part Number.
  6. Under Selected Attributes:
    1. For Block name, select CustomProperty.
    2. For Attribute name, type Part Number.
    3. For file extensions, select the file types to use the part number variable.
  7. Click OK.
  8. Open the data card that is associated with the file types.
  9. Add a control that uses a variable.
  10. In the control's property pane:
    1. Under Value, for Variable name select Part Number.
    2. Under Default value, select Serial Number.
    3. To ensure that a serial number is always generated, select Default overwrites.
  11. Click Save or select File > Save.
When a user adds a new file of the type associated with the data card, the Part Number variable is updated with the next available serial number.

The file's mapped property is also updated with the default value.

If you do not select Default overwrites and the variable is mapped to a file property with an existing value, the existing value is used. To generate a serial number for such files, right-click the control in the data card and select Generate next serial number. The variable and file property are updated.