Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
The Record Extended Model (REM) allows you to extend a set of table attributescolums

The table structure of REM repeats the dictionary table structure with tables and columns.  Instead Instead of columns, REM uses Attributes (sys_re_attribute) are used in REM. You can connect REM attributes with a table within the the Model (sys_re_model). Besides, you You can also 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 Use the Record Extended Model (REM) menu category to access tables related to REM

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 column set as the parent one, and individual attributes inaccessible from the parent table. For example, the diagram below shows that all attributes columns of the User table are inherited by the Employee table:

Attributes extension circuit diagram

Image RemovedImage Added

When few child tables are available, and the attribute column overlap is high, this data model works fine. But when the number of child table number tables increases, and the attribute column 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 requires more space for record storage.
  • The pace speed of script execution decreases.
  • It is getting harder difficult to configure the functionality related to the specified dictionaryspecific table, such as data import, layout setting, etc.

The Request Template Service Catalog is an example of such a table: it . It consists of a parent table for the catalog and a table record in the table for of 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 To configure your extension model, you need to:

  1. Create an extension model.
  2. Create attributes and link them to the model.
  3. (optional) Configure the attribute collection.
  4. (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. 

Note

It is not recommended to create collections with many attributes. It is better to create one collection several collections with one attribute.  This approach provides flexibility in model configuration.

Image AddedImage Removed

Create a model


To create a model, complete the steps below:

  1. Navigate to Record Extended Model (REM) → Models.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exitexit to apply the changes.

Record extended model form fields

FieldMandatoryDescription
TitleY
The
Specify the model title
. Can
that сan be specified in any language. 
TableY

Reference to the table affected by the model.

Note

Note that after the model is saved

you cannot specify another table

the Table field becomes read-only.


DescriptionNType a description for the model. 
After insert scriptNSpecify a script that should be executed after a record is created. Develop it using JavaScript extended by the SimpleOne SimpleRecord Server-Side methods.
ActiveNSelect
the checkbox
the checkbox to
make
activate the model
active or inactive
.
IconNAdd an icon to identify the model.
Related Lists
Attributes
List
A list of
the attributes
the attributes linked to this model.
Model Form Elements
List
A list of the form elements linked to this model.
Used Collections
List
A list of applied collections.
Model Client Scripts
List
A list of the model client scripts linked to this model.


Note
  • 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
  • need 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:

  1. Navigate to Record Extended Model (REM) → Attributes.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exitexit to apply the changes.

Attribute form fields

FieldMandatoryDescription
ContainerY
Reference to
Specify a previously created model.
Attribute
Type
typeYSpecify the attribute type. 
TitleYSpecify the attribute title. You can use Latin, Cyrillic letters, [0..9] numbers, and the underscore symbol ( _ ). The Title field can be translated to other languages.
Attribute
Name
nameY

Attribute system name. This field is populated automatically. Latin letters, [0..9] numbers, and the underscore symbol ( _ ) are allowed.

Map to ColumnNSpecify the target field

The field is read-only after the record is saved.

Map to columnN

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.

The field is of the Reference type and has a reference qualifier, which allow you to choose

You can select columns of the table defined in the model record and columns of its child tables.

Info

If the target

field

column is mandatory, the value will be saved before it is processed by the server validation engine.

Also, if

If the mandatory target

field is mandatory, it

column should not be displayed on the form, otherwise, the client validation engine may hamper the record saving.


Note

Mapping via the Map to

Column 

column field is available only if the column type of the attribute is equal to the target column type.

The following message appears if there is no target column

exists

in the table: 

Panel

Attribute "{attribute_name}" mapping error, reference column not found in the table


CommentsNAdd some comments to describe
your
the attribute.
ActiveNSelect the checkbox to
make
activate the attribute
active or inactive
.
Read
Only
onlyNSelect the checkbox to make the field added with this attribute read-only.
MandatoryNSelect the checkbox to make the field added with this attribute mandatory.
Type Specification tab
Dependent on
Column
columnY

Specify a

column with a

reference column of the Table. The column should have the table_id name and reference to the Table

(sys_db_table)

dictionary to build conditions.

The field appears when one of the following options is selected in the Attribute

Type

type field:

  • Field Name
  • Conditions
  • Template
Maximum
Length
lengthN

Specify a maximum value length for the attribute value. The value length cannot exceed the

allowable

allowed length for the specified data type.

The field appears when one of the following options is selected in the Attribute

Type

type field:

  • String
  • Text
  • URL
  • Password
  • Script
  • Journal Input
  • HTML
  • Encrypted Password
  • Translated Text
  • Record Class
Choice
Table 
table N
Reference to

Specify a table that stores the choice options.

The field appears when the Choice option is selected in the Attribute

Type

type field.

Choice
Field
fieldY
Reference to

Select a

particular

column of the

table specified in the

 Choice

Table

table field that contains choice options.

The field appears when the Choice

Table

table field is populated. 

Choice
Type
typeY

Define whether the None option is applicable for the field. Available options: 

  • Dropdown with --None--
  • Dropdown without --None-- (specify a default value)

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

type field. 

Extra
Attributes
attributesN

Specify additional configurations for the field. 

For example, enter the text below to apply the radio buttons style to the choice field:

choice_decorator=radio

The field appears when one of the following options is selected in the Attribute

Type

type field:

  • Choice
  • Conditions
  • Image
ReferenceY

Specify a table with the values you need.

The field appears when the List or Reference option is selected in the Attribute

Type

type field.

On
Delete
deleteN

Select the action to take when the referenced recordis deleted. Available options:

  • No action – no actions will be taken.
  • Set NULL – the reference to this record will be deleted from the field (the value will be equal to null).


Deleting records with the Set NULL option selected causes update errors for the records that reference this record in a mandatory reference field. The error occurs:

  • Warning

    When deleting a record A, an update error of a record B can occur if the record has a column that references the record A and the Action on delete for this column is Set NULL.

    Code Block
    titleError
code
  • Unable to update the {link} record because it references to the deleted one



  • Cascade – the record containing reference to it will be deleted as well.
  • Restrict – deleting the referenced record is forbidden.
  • Set default value– the reference to it will be changed to the default value defined on the Default Value tab.

The field appears when the Reference option is selected in the Attribute

Type

type field.

Default Value tab
Default
Value
valueN

Specify the default value that will be populated to the field when creating a

new

record.

This field may be specified by a JavaScript scenario as well.

The field is mandatory when the Choice type is Dropdown without --None-- (specify a default value).

Use dynamic default
Use Dynamic Default
NSelect the checkbox if you
want
need to generate the default value dynamically.
Dynamic
Default
defaultY

This field only appears when the Use

Dynamic Default

dynamic default checkbox is selected.

Select the script from the Dynamic Default Values (sys_default_value_dynamic) 

dictionary

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.

  1. The script must be preliminarily created in the Dynamic Default Values (sys_default_value_dynamic) 
dictionary
  1. table; otherwise, you will not be able to choose it.
  2. You can only
choose
  1. select active scripts (the Active checkbox is selected). 
Reference Qualifier
Reference
Qualifier Type
qualifier typeN

Specify the type of the reference qualifier. Available options:

  • Simple
  • Dynamic

The field appears when the List, Reference or Field Name option is selected in the Attribute

Type

type field.

Reference
Qualifier Condition
qualifier conditionN

Configure filters using the condition builder.

The field appears when the Simple option is selected in the Reference

Qualifier Type 

qualifier type field.

Dynamic
Reference Qualifier
reference qualifierN

Select the dynamic reference qualifier from the list. 

The field appears when the Dynamic option is selected in the Reference

Qualifier Type 

qualifier type field.

Reference
Qualifier Fixed
qualifier fixedN

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 

the Attribute

Type

type field:

  • List
  • Reference
  • Field Name

Configure an attribute collection


Attribute collections are implemented to useruse 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:

Note

It is not recommended to create collections with many attributes. It is better to create several collections with one attribute. This approach provides flexibility in model configuration.

To use it, complete the following steps:

  1. Create a collection record as described below.
  2. Fill it with previously created attributes or create
  3. Create a collection record as described below.
  4. Fill it with previously created attributes or create new ones using the Attributes related list.
  5. 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.

Info
  • If you want need to use attribute mapping in a collection, you need to specify a target 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 its child tables.

To create a collection, complete the steps below:

  1. Navigate to Record Extended Model (REM) → Collections.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exitexit to apply the changes.

Collection form fields

FieldMandatoryDescription
TitleYSpecify the collection title.
ActiveNSelect
the checkbox
the checkbox to
make
activate the collection
active or inactive
.
TableN

Specify the table to which the collection is related.

Related Lists
Attributes
On this related list, you can create a new
Create an attribute related to this collection or select an existing one from the
dictionary
table.
Form Elements
On this related list, you can create a new
Create a form element related to this collection or select an existing one from the
dictionary
table.
Used in
Model
ModelsCreate a
On this related list, you can create a new
model related to this collection or select an existing one from the
dictionary
table.
Client Scripts
On this related list, you can create a new
Create a model client script related to this collection or select an existing one from the
dictionary
table.


Note
  1. 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.
  2. The same collection and model cannot be linked to each other more than once.
  3. 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:

  1. Navigate to Record Extended Model (REM)→ Model Client Scripts.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exitexit to apply the changes.

Model client script Client Script form fields

FieldMandatoryDescription
NameYDefine the client script name.
ContainerYReference to the model or collection.
TypeY

Specify the script type. Available options:

  • onLoad – the script starts when the system displays the form for the first time before users enter data. Generally, onLoad scripts perform manipulations on the client side with the current form or default record values set.
  • onChange – the script starts when the specified field on the form has been changed.
  • onSubmit – the client-side script can cancel form submission by returningfalse.
Attribute
N
Y
Reference to
Specify a
previously
prevously created model attribute. This field is mandatory when
the 
the onChange script type is chosen.
DescriptionN
Type
Add a description
for
of the client script.
ActiveNSelect
the checkbox
the checkbox to
make
activate the script
active or inactive
.
OrderNSpecify the client script execution order. Scripts are executed in ascending order.
ScriptN

Specify the client script. 

Configure model or collection form elements


You can arrange the fields of your model or collection attributes in a particular order and position, as you can do with form layouts.

Info

You can configure the position of the collection from the Model Form Elements related list of the Model form. But the position of the attributes within the collection must be configured from the Model Form Elements related list of the Collection form.

Group attributes by common features and give them a title. In the screenshot below, custom model attributes are divided into two columns:

Image Modified

Tip

If you want need 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:

  1. Navigate to Record Extended Model (REM) → Models or Record Extended Model (REM) → Collections, depending on what you need to configure.
  2. Open the model model/collection you need.
  3. Scroll down to In the Related Lists area and open , select the Model Form Elements tab.
  4. Arrange the attributes by changing the value in the Position field. The attributes are displayed on the form in the ascending order.

    Tip

    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 layoutadd new elements to the model/collection layout (such as splits), perform the following steps:  

Anchor
add split elements
add split elements

  1. Navigate to Record Extended Model (REM) → Models or Record Extended Model (REM) → Collections, depending on what you need to configure.
  2. Open the model/collection you need.
  3. Scroll down to In the Related Lists area and open , select the Model Form Elements tab.
  4. Click New and fill in the fields.
  5. Click Save or Save and Exitexit to add the element.

Model Form Element form fields

FieldMandatoryDescription
ContainerY
Reference to
Specify a previously created model/collection. If the element is created from the related list, the field is populated automatically.
PositionYDefine the order
in which
of the element
will be
on the form. The elements are displayed on
a
the form in the ascending order.
Block
Element
elementY

Specify the type of the

splitter

element. Available options:

  • Begin – use this element to define the beginning of the block of fields. You can define the name of a group in
it. When selected,
  • the Block Title field
is displayed
  • that appears when you select this type.
  • Split – use this element to divide the
field
  • fields into columns.
  • End – use this element to define the end of the block of fields.
Block
Title
titleN
Define

Specify the title of the group of fields. The title

will be

is displayed above the attributes group on the relevant page of the Self-Service Portal.

Info

This field appears when the Block

Element

element value is Begin.



Table of Contents
absoluteUrltrue
classfixedPosition