Standard number - name - description fields
Standard definition
This fields are used for many entities in many modules. They usually come in pairs:
- number - name
- number - name - description
It is important that we keep then consistent in the whole system. If there are no special requirements for you entity you should using the standard template:
The standard definitions are described below.
Number
The number field is de facto a code this identifies an entity.
Always unique and required if not mentioned otherwise in the spec.
Currently in the system number field definition vary in some entities. There should be one standard definition so that 99% of number fields have the same character and length restrictions.
Standard max length: 255
Standard available characters: any characters (there have been problems with chars like -_/|[]
Also in real life it never consists just of numbers. It looks like: WX-101, P43, W/12/23/B.
So mathematical ordering is not required. But in the test data have to use numbers like the above to that new user know how to deal with them.
In GUI:
- text input
- the number filed should be always aligned to the left.
Name
Standard max length: 1024
Standard available characters: any characters
Always unique if
- the fields is required
- not mentioned otherwise in the spec.
In GUI: textarea with 3 rows
Description
Standard max length: 2048
Standard available characters: any characters
In GUI: textarea with 3 rows
Example
Model
In model definition we use length validator to limit string field's length.
Â
<string name="number" required="true" unique="true"> <validatesLength max="255" /> </string> <string name="name" required="true" unique="true"> <validatesLength max="1024"/> </string> <string name="description" > <validatesLength max="2048"/> </string> Â
View
In view we use text areas as a component for name and description fields. For number field we use input component.
To set text areas height, which should be 3 rows we use gridLayout layoutElement's. (see Layouts and layout elements)
Â
<layoutElement column="1" row="1"> <component type="input" name="number" reference="number" field="number"> <option type="alignment" value="left" /> </component> </layoutElement> <layoutElement column="1" row="2" height="3"> <component type="textarea" name="name" field="name" reference="name" hasDescription="true" /> </layoutElement> <layoutElement column="1" row="5" height="3"> <component type="textarea" name="description" field="description" reference="description" /> </layoutElement>
GUI / Reports formatting
If the design specification does not state otherwise then use the following rules.
 | Entities with number and name | Entities with just name or number | Entities with required number and optional name |
---|---|---|---|
Lookups |
|
|
|
Form headers | entityClassName: entityName (entityNumber} | entityClassName: entityName or entityClassName: entityNumber | entityClassName: entityNumber - entityName or entityClassName: entityNumber if name not present |
 |  |  |  |