Custom database fields can always be added utilizing any 3rd party database tool, but when added through the Database Wizard, the script adds special entries about the field in a table named data_fields. This table dictates how the data field will be displayed on the data entry screens in the Merchant control panel. On the store side, it is the web-developers responsibility to supply the necessary template variables to display and capture any custom fields.
To set up a database field for the selected table, the following entries are necessary to the creation of the database field.
- Field Name.
This is the actual database field name. Field names cannot contain blanks or other special characters. The
underscore character "_" is suitable. Field names may contain numeric digits, but must not start with a numeric digit.
- Column type. Select one of the column types. (See Column Types for more info .
- After Field. You can specify where in the database table to physically insert the field, or leave on default to insert at end of table before date stamps. This does not effect display order, and is only noticeable when using 3rd party database utilities.
- Field Length. This is the maximum length needed for the data field and applies to short text fields only. Short text fields are actually saved as VARCHAR types, which means only the number of bytes necessary to store the info will be used. The maximum length for short text fields is 255.
- Decimal Places. For numeric only. Enter the number of decimal places to store and to display.
- Signed Numeric. Check this entry for numeric fields that can possibly be negative values.
- Index on Field. Check this entry if you will be searching or sorting using this field. Unnecessary index fields can slow database operations somewhat.
The following field entries define the HTML that renders the data on the input form in the Merchant control panel.
- Descriptive label.
The descriptive label is used in the Merchant Control Panel when collecting data entries for this table.
- Form Object Type. Select the HTML input object type to use.
- Form object length. For text objects, this specifies how many columns to use in the size clause .
- Maximum length. For text objects, this specifies the maximum allowable length of input. (Should be the same or smaller than the field length specified above.)
- Rows. This is used for text areas and dropdown objects only. Indicate the number of rows to display. For dropdowns, 1 row will display a true drop down. More than 1 will display as a scrolling list.
- Special.
This field contains extra tag info about your form object type.
Textareas, enter the wrap clause you desire. (Ex. wrap=virtual)
Dropdowns and radio buttons enter the labels for the choices separated by a semi-colon (;)
- Values.
For dropdowns, enter the values for the choices in the same order as the choice labels above separated by ";". Radio buttons, enter the value to return when selected.
- Default Value. Optional. Enter a default value for the data field.
- Order on input form. This numeric value determines order the fields will be displayed within a form area. Enter a numeric integer.
- Form Area. This entry allows you to group data fields together on an input form. The dropdown displays the existing form areas. You may add another by entering in the "other" box.
- Form instructions. Optional. Enter instructions for your users to clarify what the data is, or what type of entry.
- Required. Check here if the data entry functions are to check to see if data entry is present. These can also be specified in the required fields screens. See more about required fields in the related topics list.
|