version 6.0
SET FIELD TITLES (table | subtable; fieldTitles; fieldNumbers)
| Parameter | Type | Description | |
| table | subtable | Table or Subtable | Table or Subtable for which to set the field titles | |
| fieldTitles | String Array | Field names as they must appear in dialog boxes | |
| fieldNumbers | Numeric Array | Actual field numbers |
Description
SET FIELD TITLES enables you to mask, rename, and reorder the fields of the table or subtable passed in table or subtable when they appear in standard 4th Dimension dialog boxes, such as the Query editor, within the User or Custom Menus environments.
Using this command, you can also rename on the fly the labels of the fields in your forms, if you used dynamic names. For more information about inserting dynamic field and table names in the forms, refer to the 4th Dimension Design Reference.
The arrays fieldTitles and fieldNumbers must be synchronized. In the array fieldTitles, you pass the name of the fields as you would like them to appear. If you do not want to show a particular field, do not include its name or new title into the array. The fields will appear in the order you specify in this array. In each element of the array fieldNumbers, you pass the actual field number corresponding to the field name or new title passed in the same element number in the array fieldTitles.
For example, you have a table or subtable composed of the fields F, G, and H, created in that order. You want these fields to appear as M, N, and O. In addition you do not want to show field N. Finally, you want to show O and M in that order. To do so, pass O and M in a two-element fieldTitles array and pass 3 and 1 in a two-element fieldNumbers array.
SET FIELD TITLES does NOT change the actual structure of your table. It only affects posterior uses of the standard 4th Dimension dialog boxes and forms using dynamic names within the User or Custom menus environments. The scope of the command SET FIELD TITLES is the worksession. One benefit in Client/Server, is that several 4D Client stations can simultaneously "see" your table in different manners. You can call SET FIELD TITLES as many times as you want.
Use the command SET FIELD TITLES for:
Dynamically localizing a table.
Showing fields the way you want, independent of the actual definition of your table.
Showing fields in a way that depends on the identity or custom privileges of a user.
WARNING:
SET FIELD TITLES does NOT override the Invisible property of a field. If a field is set to be invisible at the Design level of your database, even though it is included in a call to SET FIELD TITLES, it will not appear.
Each call to SET FIELD TITLES must be followed or preceded by a call to SET TABLE TITLES even though you do not want to modify the table title otherwise the command will have no effect.
Example
See example for the command SET TABLE TITLES.
See Also
Count fields, Field name, SET TABLE TITLES.