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 nameEntities with just name or numberEntities with required number and optional name
Lookups
  • number and name should be the first columns in the lookups grid
  • these columns should be filterable
  • the auto-completion mechanism should look in number for the entered phrase
  • the label value and auto-completion suggestions should be presented in the format: number - name
  • name or number should be the first column in the lookups grid
  • this column should be filterable
  • the auto-completion mechanism should look in name or number for the entered phrase
  • the label value and auto-completion suggestions should present the name or number
  • name and number should be the first column in the lookups grid
  • these column should be filterable
  • the auto-completion mechanism should look in number for the entered phrase
  • the label value and auto-completion suggestions should present the format:
    • if name is present: number - name
    • if not then just: number
Form headersentityClassName: entityName (entityNumber}

entityClassName: entityName

or

entityClassName: entityNumber

entityClassName: entityNumber - entityName

or

entityClassName: entityNumber

if name not present

   Â