Define extended attribute information

Where you are

   Create the database table

>   Define extended attribute information

   Add data to the table

Now you extend the basic definitions of the columns in the table.

The following table summarizes how you extend the column definitions of the contact1 table columns.

Column name

What you do to extend its definition

id

last_name

first_name

Nothing.

title

Define a DropDownListBox edit style of job roles, change the column header and label to Job Role, and enlarge the display width of the column to 1.5 inches (3.81 cm).

street

city

Nothing.

state

Assign the DropDownDataWindow edit style for state to the state column.

Set the default value of state to MA.

zip

Nothing.

phone

fax

Define an Edit Mask edit style for a phone number and apply it to phone and fax.


About extended attribute information

InfoMaker stores extended attribute information in the extended attribute system tables and uses it to display and validate data in forms and reports. In the Report painter or Form painter, you can override whatever you specified in the Database painter, which is where you are now.

Define a DropDownListBox edit style for the title column

Now you define a DropDownListBox edit style that has the valid job roles for the title column. When you have finished, this is what it looks like in a form.

  1. Select View>Layouts>(Default) from the menu bar.

  2. Click the Extended Attributes tab to bring the view to the front.

  3. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    The Edit Style dialog box displays.

  4. Enter the name JobRoles1.

    Select DropDownListBox in the Style box next to Edit Style.

    Check Sorted to alphabetize your entries.

    Check Vertical Scroll Bar to display a vertical scroll bar on your list.

  5. Enter the Display Values and Data Values shown in the table below.

    Be sure to use lowercase for the data values.

    To enter each pair of values, type the values and press the Tab button.

    For the last pair of values, do not click Tab.

    Display Value

    Data Value

    Sales

    sa

    Customer support

    cs

    Product development

    pd

    Administration

    ad

    Training

    tr

    Documentation

    do

    Marketing

    ma

    Human resources

    hr

    Finance

    fi

    Other

    ot


    When you finish entering values, the Edit Style dialog box looks like this.

    About display values and data values

    Display values show in forms and reports. Data values are stored in the database. Display values should be meaningful -- such as Human Resources. In contrast, data values are often codes that are short -- such as hr. Short codes conserve space in the database.

  6. Click OK to accept the definition of the DropDownListBox Edit Style named JobRoles1.

    InfoMaker adds the JobRoles1 edit style to the extended attribute system tables in the database and lists it as one of the available edit styles in the Extended Attributes view.

  7. Expand the tree view of Edit Styles by clicking the plus (+) sign.

    Use the scroll bar to scroll down to the JobRoles1 Edit Style.

    Now that JobRoles1 is defined in the extended attribute system tables, you can use it for any appropriate column in any table in the database. You are going to assign it to the title column in the contact1 table.

  8. Expand PB Demo DB V2017 IM in the Objects view to display Tables and then the Columns in the contact1 table.

    Display the pop-up menu for the title column and select Properties.

    The Object Details view now includes the property sheets for the title column.

  9. If the Edit Style tab is not visible, use the arrows in the upper-right corner of the Object Details view to display the Edit Style tab.

    Click the Edit Style tab to bring it to the front.

  10. Scroll the list of edit styles until JobRoles1 displays.

    Click it to apply the edit style JobRoles1 to the title column.

    Select File>Save from the menu bar.

Change the column header, label, and display width of title

Now you change the label and header text for the title column. The text you supply appears on forms and reports you create.

The column name is title, but the text you want to display is Job role. Also, you change the display width to 1.5 inches (3.81 cm). The internally stored data value is only two characters, but the values you intend to display are longer.

  1. The title column should still be current (if not, display its pop-up menu and select Properties).

    Click the Headers tab to bring the Headers property page for the title column to the front in the Object Details view.

    All the extended attribute information for a column is definable using the various pages in the Object Details view.

  2. Type Job Role in the Label box.

    Type Job Role in the Heading box.

  3. Click the Display tab to bring the Display page to the front.

    Type 1.5 in the Display Width box.

  4. Select File>Save from the menu bar.

    InfoMaker adds the extended attribute information for the column to the extended attribute system tables.

Assign a DropDownDataWindow edit style and initial value to state

For the state column, you assign an edit style that includes all the state names (as well as the provinces of Canada). Then when you enter information into this field, you pick from a list of states. You also set the initial value to MA, since many of your contacts are in Massachusetts.

  1. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    The Edit Style dialog box displays.

  2. Type StateCode1 in the Edit Style box.

    Select DropDownDW from the Style drop-down list.

    Click the ellipsis next to the DataWindow drop-down list.

    The Open dialog box displays.

    Select d_dddw_states and click OK.

    The StateCode1 edit style uses a report (DataWindow) named d_dddw_states. The report gets its values from the state table.

    About DropDownDataWindow edit styles

    A DropDownDataWindow edit style gets its values from a report that it references. The report gets its values from the database.

    This is what the d_dddw_states report looks like.

  3. Select state_id from the list for Display Column and for Data Column.

    Type 550 for the Width of DropDown.

    Select Vertical Scroll Bar.

    Click Save to accept the definition of the StateCode1 edit style.

    InfoMaker adds the StateCode1 edit style to the extended attribute system tables, where it is available to be assigned to any appropriate column in the database. Now you assign it to the state column in the contact1 table.

  4. Display the pop-up menu for the state column in the contact1 table and select Properties.

  5. In the Column Properties view, select the Edit Style tab.

    Select StateCode1 for the edit style to assign to the state column.

    (If the StateCode1 edit style is not listed, select View>Reset View. This refreshes the list of edit styles.)

    This assigns the StateCode1 edit style (which includes 63 entries -- states, territories, and possessions of the United States and provinces of Canada) to the state column in the contact table. The values that this edit style displays and the values that it stores are state postal abbreviations (such as MA for the state of Massachusetts).

  6. Click the Validation tab.

    Make sure the Validation Rule setting is (None).

    Type MA in the Initial Value box.

    This assigns an initial value of MA to the state column.

    The Validation page lets you create and assign a validation rule to a column and enter an initial value for the column.

    You are not going to assign a validation rule. You have handled validation by forcing the user to select from exactly 63 valid values presented in the States drop-down DataWindow.

    About column validation rules

    You can use column validation rules to express requirements for entries in a column. For example, you could define a rule for a salary column that requires salaries to be greater than $15,000 and less than $100,000.

    When you assign a column validation rule to a column, no one can enter a value that breaks the rule.

  7. Select File>Save from the menu bar.

    InfoMaker saves the extended attributes you just defined for the state column in the extended attribute system tables.

Define an Edit Mask edit style for phone and fax

Now you define an Edit Mask edit style to display phone and fax numbers for both viewing and editing.

  1. In the Extended Attributes view, display the pop-up menu for Edit Styles and select New.

    The Edit Style property displays.

  2. Type TelephoneNumber1 in the Edite Style box.

    Select EditMask in the Style drop-down list.

    Delete xxx and type (###) ###-#### in the Mask box.

    This specifies the edit mask.

    The pound signs (#) in the Mask box are placeholders for numbers. Only numbers 0 through 9 can be entered in each of these positions. Parentheses, the hyphen, and the space are where you want them to display.

  3. Click Save to accept the definition of the Edit Mask edit style named TelephoneNumber1.

    InfoMaker adds the TelephoneNumber1 edit style to the extended attribute system tables in the database and lists it as one of the available edit styles in the Extended Attributes view.

  4. Display the pop-up menu for the phone column and select Properties.

  5. In the Object Details view, click the Edit Style tab, then scroll the list and select the TelephoneNumber1 edit style.

    This assigns the TelephoneNumber1 edit style to the phone column. Now you use the same edit style with the fax column. Once you have created an edit style, it is available for any column.

  6. Display the pop-up menu for the fax column and select Properties.

    InfoMaker prompts you to save the changes you just made in assigning the TelephoneNumber1 edit style to the phone column.

  7. Select Yes.

  8. In the Object Details view for the fax column, select the Edit Style tab and the TelephoneNumber1 edit style.

    Select File>Save from the menu bar.

Now you have finished extending the definitions of your columns. Next you add data to the table.