You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 27 Next »
The table structure of REM repeats the dictionary structure with tables and columns. Instead of columns, Attributes (sys_re_attribute) are used in REM. You can connect REM attributes with a table within the Model (sys_re_model). Besides, you can create attribute collections as universal sets of attributes that can be used in several models at the same time.
You can access dictionaries related to REM through the Record Extended Model (REM) menu category.
REM concept
Every table has its own data model specified by the business logic. The data model is represented by the column set. This data model can be extended with a child table containing the same attribute set as the parent one, and individual attributes inaccessible from the parent table. For example, the diagram below shows that all attributes of the User table are inherited by the Employee table:
Attributes extension circuit diagram
When few child tables are available, and the attribute overlap is high, this data model works fine. But when the child table number increases, and the attribute overlap decreases, the management of this data model becomes a challenge. The data model with a large and complicated table inheritance structure has some disadvantages:
- It is required to allocate more space for record storage.
- The pace of script execution decreases.
- It is getting harder to configure the functionality related to the specified dictionary, such as data import, layout setting, etc.
The Request Catalog is an example of such a table: it consists of a parent table for the catalog and a record in the table for each request template with specific attributes.
The Record Extended Model (REM) concept addresses the issue described above. The extension concept can be applied to a specific table record, by assigning additional attributes to it.
When a record extension model is applied to a record, it means that an auxiliary record set is created for this record containing information about specific attribute values. Therefore, the record has attributes inherited from a table, and in addition, it has attributes sourced from the extension model.
Configure an extension model
Generally, to configure your extension model, you need to:
- Create an extension model.
- Create attributes and link them to the model.
- (optional) Configure the attribute collection.
- (optional) Configure a model client script.
In the diagram below, you can see the difference between models and collections. Models are created with a specific attribute set that can only be used in this model. Collections contain attributes that can be applied to different models.
It is not recommended to create collections with many attributes. It is better to create one collection with one attribute.
Create a model
To create a model, complete the steps below:
- Navigate to Record Extended Model (REM) → Models.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Record extended model form fields
Field | Mandatory | Description |
---|---|---|
Title | + | Specify the model title that сan be specified in any language. |
Table | + | Reference to the table affected by the model. Note that after the model is saved the Table field becomes read-only. |
Description | - | Type a description for the model. |
After insert script | - | Specify a script that should be executed after a record is created. Develop it using JavaScript extended by the SimpleOne SimpleRecord Server-Side methods. |
Active | - | Select the checkbox to activate the model. |
Icon | - | Add an icon to identify the model. |
Related Lists | ||
Attributes | A list of the attributes linked to this model. | |
Model Form Elements | A list of the form elements linked to this model. | |
Used Collections | A list of applied collections. | |
Model Client Scripts | A list of the model client scripts linked to this model. |
- Do not create or add an attribute to a model if an attribute with the same name already exists in this model.
- Do not rename an existing attribute if there is an attribute in the model with the name you want to enter.
Configure an attribute
In SimpleOne, you can create attribute mapping for models and collections. Data mapping is the process of connecting a data field from one table to a data field in another table. It reduces the potential for errors, helps standardize your data, and makes it easier to understand your data because it establishes direct relationships among your data across multiple tables at once.
To create an attribute, complete the steps below:
- Navigate to Record Extended Model (REM) → Attributes.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Attribute form fields
Field | Mandatory | Description | |
---|---|---|---|
Container | + | Reference to a previously created model. | |
Attribute type | + | Specify the attribute type. | |
Title | + | Specify the attribute title. You can use Latin, Cyrillic letters, [0..9] numbers, and the underscore symbol ( _ ). | |
Attribute name | + | Attribute system name. This field is populated automatically. Latin letters, [0..9] numbers, and the underscore symbol ( _ ) are allowed. | |
Map to column | - | Specify the target field to map the attribute value before the record is inserted (including business rules of the before type). This option allows you to quickly transfer attribute values to fields. You can select columns of the table defined in the model record and columns of its child tables. If the target field is mandatory, the value will be saved before it is processed by the server validation engine. Also, if the target field is mandatory, it should not be displayed on the form, otherwise, the client validation engine may hamper the record saving. Mapping via the Map to column field is available only if the column type of the attribute is equal to the target column type. The following message appears if no target column exists in the table:
| |
Comments | - | Add some comments to describe your attribute. | |
Active | - | Select the checkbox to make the attribute active or inactive. | |
Read only | - | Select the checkbox to make the field added with this attribute read-only. | |
Mandatory | - | Select the checkbox to make the field added with this attribute mandatory. | |
Type Specification tab | |||
Dependent on column | + | Specify a column with a reference to the Table (sys_db_table). The field appears when one of the following options is selected in the Attribute type field:
| |
Maximum length | - | Specify a maximum value length for the attribute value. The value length cannot exceed the allowable length for the specified data type. The field appears when one of the following options is selected in the Attribute type field:
| |
Choice table | - | Reference to a table. The field appears when the Choice option is selected in the Attribute type field. | |
Choice field | + | Reference to a particular column of the table specified in the Choice table field. The field appears when the Choice table field is populated. | |
Choice type | + | Define whether the None option is applicable for the field. Available options:
If the Dropdown without --None-- is chosen, the Default value field becomes mandatory. The field appears when the Choice option is selected in the Attribute type field. | |
Extra attributes | - | Specify additional configurations for the field. For example, enter the text below to apply the radio buttons style to the choice field:
The field appears when one of the following options is selected in the Attribute type field:
| |
Reference | + | Specify a table with the values you need. The field appears when the List or Reference option is selected in the Attribute type field. | |
On delete | - | Select the action to take when the referenced record is deleted. Available options:
The field appears when the Reference option is selected in the Attribute type field. | |
Default Value tab | |||
Default value | - | Specify the default value that will be populated to the field when creating a new record. | |
Use dynamic default | - | Select the checkbox if you want to generate the default value dynamically. | |
Dynamic default | + | This field only appears when the Use dynamic default checkbox is selected. Select the script from the Dynamic Default Values (sys_default_value_dynamic) table, so its execution result will be automatically calculated and entered into this field; this value will be the default value for the column specified.
| |
Reference Qualifier | |||
Reference qualifier type | - | Specify the type of the reference qualifier. Available options:
The field appears when the List, Reference or Field Name option is selected in the Attribute type field. | |
Reference qualifier condition | - | Configure filters using the condition builder. The field appears when the Simple option is selected in the Reference qualifier type field. | |
Dynamic reference qualifier | - | Select the dynamic reference qualifier from the list. The field appears when the Dynamic option is selected in the Reference qualifier type field. | |
Reference qualifier fixed | - | Select the checkbox to fix filters in breadcrumbs. This functionality blocks the use of the condition builder functionality. The field appears when one of the following options is selected in the Attribute type field:
|
Configure an attribute collection
Attribute collections are implemented to use Many-to-Many Relationships, so they allow you to reuse the same attributes across models instead of adding them separately to each model where necessary.
The simplified concept of use is:
- Create a collection record as described below.
- Fill it with previously created attributes or create new ones using the Attributes related list.
- Relate this collection with previously created models using the Used in Models related list.
After that, all the attributes contained in this collection are used by all models this collection relates to.
- If you want to use attribute mapping in a collection, you need to specify a table in the Table field of a collection. Otherwise, leave the Table field empty.
- Collections with the populated Table field can only be added to models with the same table specified or to models of child tables.
To create a collection, complete the steps below:
- Navigate to Record Extended Model (REM) → Collections.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Collection form fields
Field | Mandatory | Description |
---|---|---|
Title | + | Specify the collection title. |
Active | - | Select the checkbox to make the collection active or inactive. |
Table | - | Specify the table to which the collection is related. |
Related Lists | ||
Attributes | On this related list, you can create a new attribute related to this collection or select an existing one from the dictionary. | |
Form Elements | On this related list, you can create a new form element related to this collection or select an existing one from the dictionary. | |
Used in Models | On this related list, you can create a new model related to this collection or select an existing one from the dictionary. | |
Client Scripts | On this related list, you can create a new model client script related to this collection or select an existing one from the dictionary. |
- Do not rename an existing attribute in the collection if there is an attribute in the model or in the collection linked to the model with the name you want to enter.
- The same collection and model cannot be linked to each other more than once.
- A model and a collection that have at least one eponymous attribute matching the model attribute cannot be bound between each other.
Configure a model client script
To create a record extended model client script, complete the steps below:
- Navigate to Record Extended Model (REM)→ Model Client Scripts.
- Click New and fill in the fields.
- Click Save or Save and exit to apply the changes.
Model Client Script form fields
Field | Mandatory | Description |
---|---|---|
Name | + | Define the client script name. |
Container | + | Reference to the model or collection. |
Type | + | Specify the script type. Available options:
|
Attribute | - | Reference to a previously created model attribute. This field is mandatory when the onChange script type is chosen. |
Description | - | Type a description for the client script. |
Active | - | Select the checkbox to make the script active or inactive. |
Order | - | Specify the client script execution order. Scripts are executed in ascending order. |
Script | - | Specify the client script. |
Configure model form elements
You can arrange the fields of your model attributes in a particular order and position, as you can do with form layouts. Group attributes by common features and give them a title. In the screenshot below, custom model attributes are divided into two columns:
If you want to define a title for a group of attributes organized in one block, use the Begin element.
The title will appear on the relevant page of the Self-Service Portal.
To change the order of the displayed attributes, perform the following steps:
- Navigate to Record Extended Model (REM) → Models.
- Open the model you need.
- In the Related Lists area, select the Model Form Elements tab.
Arrange the attributes by changing the value in the Position field.
Use the inline editing: double-click the cell in the Position column, enter the value, and press Enter to save the changes.
To configure a model layout, perform the following steps:
- Navigate to Record Extended Model (REM) → Models.
- Open the model you need.
- In the Related Lists area, select the Model Form Elements tab.
- Click New and fill in the fields.
- Click Save or Save and exit to add the element.
Model Form Element form fields
Field | Mandatory | Description |
---|---|---|
Container | + | Reference to a previously created model. If the element is created from the related list, the field is populated automatically. |
Position | + | Define the order in which the element will be displayed on a form. |
Block element | + | Specify the type of the splitter. Available options:
|
Block title | - | Define the title of the group of fields. The title will be displayed above the attributes group on the relevant page of the Self-Service Portal. This field appears when the Block element value is Begin. |
- No labels