Adding Expression Fields to Screens
Use expressions to create titles or text messages on screen or to create calculated fields (fields that contain a mathematical expression rather than data). Calculated fields have no value; they only display a value, so reporting or filtering cannot take place on the field. If filtering or reporting is required, create a field and use the Lookup.ini to calculate its value. The Lookup.ini returns a value.
Use the following procedure to add an expression field to a screen.
1. | Select the Fields tab and right-click in the area under the tab. Select the screen to which you are adding the field. |
The selected custom screen becomes active under the Fields tab.
2. | Right-click and select Screen Design. |
The GoldMine Screen Designer Toolbar toolbar appears with a grid-like background in the Contact record (see Adding Fields to Screens).
3. | Click New on the design toolbar to open the Place Field dialog box. |
4. | At the Field drop-down list; select -- dBASE Expression --. |
5. | Click OK. |
The field box appears in the upper left corner of the Fields tab. Drag and drop the field in the desired location on the Field Screen.
6. | Double-click to open the Field Properties dialog box. |
7. | In the Field Label area on the Type tab, select either: |
○ Global Label. Designate the Global Label that applies to all databases. With Expression fields, the Local Label is not an option.
○ Expression. Type text in quotes or type a field expression.
Examples:
- To create a text expression label, type Total:in the Field Label area Expression box. GoldMine displays Total: as the field label.
- To create a field expression label, type Contact1->Company in the Expression box. GoldMine displays the first 15 characters of the company name as the field label.
8. | If you use Expression as a field label, type the Label Reference label for the expression field. |
9. | In the Field Data area, select Expression and type the expression that displays the field value. |
Example:
For two numeric fields, called USUM1 and USUM2, create a calculation expression to add them together. For example, Contact2->USUM1+Contact2->USUM2. Remember, you cannot report on the total value. If you create a complex expression, test it using the dBASE Expression Tester.