GR:Gravity/Definitions/Extending Types

From Remain Software
Jump to navigation Jump to search

Extending Types

You are able to extend types with your own fields. You might want to add a Department code to the Enhancement Item Type. In this part of the tutorial we will show you how to do this.

You can extend all Types but also all Base Types. Every Type will inherit the Extended Fields of the Base Type.

Open the Definitions view again, expand the Types and expand Items. Then open the context menu on Enhancement and select Show Extended Fields.


Gr openextendedfield.png


The Gravity Extended Entity Type Admin view will open. In this view you can open the context menu on any of the Types to add a field of a specific type.


Gr createextendedfield1.png


String Field
Choose this if you want to add a free or bounded character value. The field becomes bounded (i.e. the user can only select a value) if you have added values to field after it is defined.
Number Field
Enables the user to add a number or select from a range of numbers.
Date Field
Enables the user to select a date.
Entity Field
Enables the user to select a value from the Gravity database. For example, select an Application, Workflow, User or an Item.
Entity Type Field
Enables the user to select a value from the Gravity database from any of the defined Types. For example, select an Enhancement, or Question.
Secret Field
A field that does not show its value when typed. It is stored encrypted in the database but it can be decrypted to the original value.


Right click on the Enhancement type and select New String Field. In the dialog that appears enter the following attributes.


Gr addextendedstringfield.png

Field Name
The name of the field
Field Label
The label that is presented to the user
Field Weight
If you add more fields to the Type then the Field Weight governs the position in the form. The higher the weight the more it will be in the bottom of the form.

Adding Values

Right click the field to open the context menu and choose 'Add Values'. This will open a simple dialog which enables you to add a comma separated list of values.


Gr addvaluestoextendedfield.png


The final result looks like this:


Gr resultofaddedvalues.png




Final Results

In the image below you see how the final result looks in the Web Client. Extended fields are of course also available in the rich client.


Gr extfexample1.png