The normal class constructor, Construct_Object, is used to define all attributes of a Data Dictionary. This constructor method defines the following types of information:
Table Attributes: These define the attributes that apply to the entire table. This connects your Data Dictionary to a specific Table and defines the basic capabilities of the Data Dictionary.
Field Attributes: These define attributes for each field (column) in your table. This provides field validation rules, finding rules, and much information that is used by the data entry objects.
Foreign Field Attributes: These define attributes for your fields when the Data Dictionary object is used in a parent (foreign) role in the DDO structure.
Parent / Child Table Relationships: This defines the relationship rules between tables. This is used to help build DDO structures and to verify that these structures are capable of properly supporting database updates.
All of these settings are created and maintained using the Studio’s Data Dictionary Modeler. Listed below is a sample Construct_Object that was created using the Data Dictionary Modeler:
Procedure Construct_Object
Forward Send Construct_Object
Set Main_File To OrderHea.File_Number
Set Foreign_Field_Option DD_KEYFIELD DD_FINDREQ to True
Set Foreign_Field_Option DD_INDEXFIELD DD_NOPUT to True
Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to True
Set Add_Client_File to OrderDtl.File_Number
Set Add_Server_File to Customer.File_Number
Set Add_Server_File to SalesP.File_Number
Set Add_System_File to OrdSys.File_Number DD_LOCK_ON_NEW_SAVE_DELETE
Set Field_Auto_Increment Field OrderHea.Order_Number to File_Field OrdSys.Order_Number
Set Field_Option Field OrderHea.Order_Number DD_AUTOFIND to True
Set Field_Prompt_Object Field OrderHea.Order_Number to OrderHea_SL
Set Key_Field_State Field OrderHea.Order_Number To True
Set Status_Help Field OrderHea.Order_Number To "Order Number - New orders are assigned numbers automatically"
Set Field_Class_Name Field OrderHea.Order_Date To "dbSpinForm"
Set Field_Entry_msg Field OrderHea.Order_Date To Entry_Order_Date
Set Field_Mask_Type Field OrderHea.Order_Date To MASK_DATE_WINDOW
Set Field_Prompt_Object Field OrderHea.Order_Date to OrderHea_SL
Set Status_Help Field OrderHea.Order_Date To "Date on which the order was placed"
Set Field_Class_Name Field OrderHea.Terms To "dbComboForm"
Set Field_Value_Table Field OrderHea.Terms to Terms_table
Set Status_Help Field OrderHea.Terms To "Payment terms"
Set Field_Class_Name Field OrderHea.Ship_Via To "dbComboForm"
Set Field_Value_Table Field OrderHea.Ship_Via to Ship_Table
Set Status_Help Field OrderHea.Ship_Via To "Shipping method"
Set Status_Help Field OrderHea.Ordered_By To "Order placed by"
Set Field_Label_Long Field OrderHea.Salesperson_ID To "Sales Person ID"
Set Field_Label_Short Field OrderHea.Salesperson_ID To "Sales ID"
Set Status_Help Field OrderHea.Salesperson_ID To "Sales Person who initiated the order"
Set Field_Mask_Type Field OrderHea.Order_Total To MASK_CURRENCY_WINDOW
Set Field_Option Field OrderHea.Order_Total DD_DISPLAYONLY to True
End_Procedure
Defining Data Dictionary Classes