Tips - Reusable Interface Objects - Part 2
Thursday, December 7th, 2006A common request for help we get is; How do I Define Reusable Data Objects?
So here is a quick step by step guide:
Creating a field model
1. Go to the Model repository (Shift+F1), and move to the desired location.
2. Press F4 (Edit->Create Line).
3. Type in the name of the model (here it is “Status Code”).
4. Select the class of Field.
5. Select the attribute you need. For a field model, this would be one of your basic data types: alpha, numeric, date, time, blob, ActiveX, etc.
6. Now go to the model properties pane
(Alt+Enter) and set the properties you need.
Details: In this section, you can specify the length and format of the field in its picture. You can also specify the valid values of the field, either as a range (i.e. A-Z) or as discrete values. Here we have a 1-character uppercase field, with 4 possible values.
Input: You can specify a program that will appear when the user presses F5 or double-clicks (zoom), to aid in selecting a value.
Appearance: Here you can attach a help screen, tooltip, or prompt to show on the prompt line.
Style: This section specifies how the data will appear depending on where it is displayed.
In this case, our status code will appear as a radio button on most GUI display screens, but will show up as a combo box if it is on a GUI table.
Def/Null: Determines how nulls are used, and if the field has a default value.
Storage/SQL: Here you can specify how the data will be stored in the DBMS.
As you can see, the field models give you a lot of control over how data will be formatted and used in your application. Once the field model is created, you can use it for any instance of this type of data. In this case, we would use it for the status code as it exists in records, as it is passed as a parameter, and in temporary variables in programs.











