Creating custom field attributes
Custom field attributes specify how a field will be displayed in a form or report, irrespective of the form’s default control settings. You can create custom field attributes in the Table designer to control special properties and events on forms and reports. Whenever a field is dataLinked to a control, all custom field attributes are copied to the control.
Custom field attributes are named field properties that contain a string value. These attributes form an active data dictionary that functions at both design and runtime. Attributes are listed under the Inspector’s Custom category.
Properties assigned to fields by creating custom field attributes are not streamed. Therefore, you can change the attribute in the table without having to change your code. If you later change the field’s attributes, the changes are automatically applied to the control dataLinked to the field. No change to a report or form is necessary.
By using custom field attributes, you can cause a table’s field to have its own special font, color, or format that will be reproduced on any form or report whose controls are datalinked to it. For example, you can assign a picture attribute to a PHONE field. When you dataLink an entryfield control to the PHONE field, that entryfield control will automatically take on the picture property that was assigned as the field’s picture attribute.
To create custom field attributes in the Table designer,
Select the field for which you want to create a custom attribute.
Right-click the Inspector. From the context menu, choose New Custom Field Property...
In the dialog box, enter a name for the new field attribute. For example, if your table contains a phone number field whose data you want to appear in forms in a particular phone number format, you would type picture to add the picture property (which provides data format templates, not images).
Now enter a value for the new field attribute. If you used the picture property, you might add a template value for the property, such as 999-999-9999 for a USA phone number template.
The new field attribute appears in the Inspector, listed under the Custom category.
To edit or delete custom field attributes,
In the Inspector, select the custom field attribute.
Right-click the inspector to display the context menu.
Choose Edit or Delete Custom Field Property from the context menu.
No checks are performed on the attribute name; be sure not to create attributes, such as "Name," that will cause undesired property name conflicts. Attributes with names not used by the component simply become custom properties of the component.