Page 777 - ExtendSim User Guide
P. 777

In the dialog that opens, enter 2 for the number of records and click Add Records.
Entering values for the cells
In the viewer, enter 10 as record #1 and 20 as record #2.
If the table viewer window is open, close it.
Close the database window and Save the model. Databases are saved with the model when the model is saved.
Data Management and Exchange 751
ExtendSim databases for internal data storage
Table Viewer showing two records
Notice that My Database is listed at
the bottom of the Database menu. If the Navigator is opened to Database List mode, the data- base will also be listed there. Making a copy of the ReservoirDB model causes the copy to also have a database named My Database.
Establishing Parent/Child relationships
To illustrate another powerful database feature, the following example adds a new table to the database created in the previous section and makes the table’s field the parent for the field in the original table. This will establish a parent/child relationship, causing My Table to get its values from the new table.
Establishing a parent/child relationship between fields is optional but powerful. It is useful for many situations, such as providing a components list for a specific product, a selection of cus- tom colors for a particular model of car, or the properties of a material. Having a parent/child relationship limits a field’s set of data to what is present in the parent. Instead of entering data directly into the child field, you select the data from a popup data selector that shows all the possible values from the parent field.
Parent fields have a red background and tables that have parent fields are listed in the database window’s tabs in red; child fields have green backgrounds and tables that have child fields are listed in green.
How to create a parent/child relationship
The following example builds on the ReservoirDB model created in the example “How to cre- ate an ExtendSim database” on page 748. It assumes you know how to add tables, fields, and records to a database.
Open the ReservoirDB model you created earlier.
Open the window for My Database by selecting My Database at the bottom of the Database
menu. Or use one of the methods discussed in “Opening a database window” on page 755. Create a new table and name it Parent.
Select the Parent table and:
Append a new field and name it Contents.
Leave the other settings in the Field Properties dialog at their default settings and click Save Field.
How To


































































































   775   776   777   778   779