Customizing a Data Dictionary for the Sales Persons Table
In this section, you will customize the cSalesPersonDataDictionary that was automatically created when you created the table. You will add some business rules and other settings to the Data Dictionary. The reason for each Data Dictionary setting you apply will be explained.
The exceptions are business rules already explained when you created the previous Data Dictionaries in the Customizing the Data Dictionaries book. Most explanations can be read in the Customizing a Data Dictionary for the Customer Table page, since this is the first Data Dictionary created.
Steps to Customize the Data Dictionary
-
In Table Explorer, expand the
SalesPersontable to display its Columns, Indexes, Relationships, and Data Dictionaries. You will seecSalesPersonDataDictionarylisted. -
Double-click on the
cSalesPersonDataDictionaryclass. The class will now open in the Studio's Data Dictionary Designer. -
On the Data Dictionary Designer's Columns tab page:
-
Select the
Idcolumn and set the Auto Find EQ option in the Data Entry Option group toTrue.
The sales person Id is not system-assigned -- users must enter a valid Id. Auto Find EQ will ensure that the Id is unique. If the Id already exists, the existing record will be automatically found.
Also set Capslock, Required, and Protect Value (Key) toTruefor theIdcolumn.
This option combination sets the column options to require and automatically find a sales person record and to convert all data entered into the associated form into uppercase. -
Select the
Idcolumn and set the Long Label option in the Appearance group toSales Person Id. Set the Short Label toId.
Select theNamecolumn and set the Long Label option toSales Person Name. Set the Short Label toSales Person Name. -
Select the
Idcolumn and set the Status Help option in the Appearance group toSales Person Id code - Upper-case alpha.
Select theNamecolumn and set the Status Help option toSales Person name - first and last. -
Click on the Structures tab page of the Data Dictionary Designer.
For Key Foreign Field Options, verify that Find Required and No Put are checked.
For Indexed Foreign Field Options, just No Put should be checked.
For Default Foreign Field Options, just Display Only should be checked. -
If the Code Explorer window is not open, click on the Code Explorer toolbar button.
You may have to click on any focusable window in the Data Dictionary Designer, such as the Class Name form, for Code Explorer to populate.
Select thecSalesPersonDataDictionaryclass in Code Explorer. -
Click on the Properties toolbar button to open the Properties window.
Set the Cascade_Delete_State property toFalse.
Business Rule #10 states that if a sales person is responsible for any existing orders, you cannot remove that sales person’s record from theSalesPersontable. Disallowing Cascade Deletes enforces that rule. -
Click the Save File toolbar button (or press
Ctrl + S) to save the Data Dictionary.