Default values for module links

Prev Next

It is possible to define default preselection rules for module link on the tab “Default value” in the field definition settings. A set of rules can be added and chained using “AND/OR” logic. It is possible to create, edit, delete rules that are represented by two selectboxes: “Fields in linked module” and “Prefill by”.

image137.png

Fig.: Default value configuration window for module link fields

The default value can be defined using these two selectboxes by comparing the content of the fields mapped in them.

  • Fields in linked module selectbox contains the list of fields available by the module link that is currently being configured (i.e. the fields of the linked module). It gives the possibility to define which field in linked module we want to compare with in order to find default value.

  • Prefill by selectbox contains the list of fields from current module, the chosen field will be used as a “trigger” for default value preselection. It is also possible to select “Current user” option that can be used for prefilling module link with a currently logged in user (if module link points to the module with users). Also it is possible to use static values for prefilling by selecting the “Static value” option. 

Configured module link field will be preselected with particular value respecting the configured preselection rules. Prefilling is applied on opening the New Item window and also “on the fly” when manually change the “triggering” field. The “triggering” field can be of any type, including simple text, simple options and module links.

Prefilling can be configured for both single and multiselect fields. For multiselect fields all the values that match the rule will be prefilled. In case of single select field type the first values in the list that matches the rule will be prefilled.

To create a new rule click the “+” icon on “Default values” tab and select the values in configuration selectboxes. Next table explains how to configure the default value preselection for the module link field definition for different cases:


#


Case

Rule for default value preselection

Fields in linked module

Prefill by

1

The module link to User management module is prefilled with current user

{FieldWithUserName}

CURRENT USER

2

The module link is prefilled on the fly according to the value specified in another field in same module (that should be understood as a “trigger”)

{Field}


(Field you want to compare with a “trigger”)

{Field}


(A field in the current module that you want to use as a “trigger”)

3

The module link is prefilled on the fly according to the value related to another module link field (so comparison can be done with values of fields in the module “trigger” module link points to)

{Field}


(Field you want to compare with related value of the “trigger”)

{ModuleLink.Field}


(A field in the module “trigger” module link points to)

4

The module link is prefilled according to the predefined static value of another field of optioned type

Note! Prefilling by static values is limited to optioned fields only.

{Field}


(Field with options: simple or module link. To be compared with its own values specified in “Prefill by — static value” selectbox)

STATIC VALUE

{value1}

{value2}

...


(several static values can be selected at once, comparison will be provided according to OR logic)

5

The module link is prefilled according to the combination of rules chained by AND/OR logic.

  • AND means that default value will be prefilled if and only if the value matches all the rules specified.

  • OR means that default value will be prefilled if the value matches at least one of the rules specified.

AND/OR

rule 1

rule 2

rule 3

...

Example for case 1

Having a module link to User management module Users in the module Briefs we want to prefill it with a current user.

image139.png

Prefilling rule for the field User will be:

Fields in linked module

Prefill by

Users.User Name

Briefs.User

With this rule we literally tell the system: “Prefill those user who has a name equal to the name of the Current User”. 

Example for case 2

Each user has an associated organization he represents. We want User module link field to be prefilled automatically according to the selected organization. Selecting an organization in Organization field will preselect corresponding user representative.

image140.png

Prefilling rule for the field User will be:

Fields in linked module

Prefill by

Users.Organization

Briefs.Organization

With this rule we literally tell the system: “Prefill those user whose organization is equal to the one selected in Organization field of the module Briefs”. 

Example for case 3

Each user has an associated client he responsible to. We want “Client” module link field to be prefilled automatically according to the user selected. Selecting a user in the “User” field will preselect corresponding user’s client in the field “Client”.

image141.png

 Prefilling rule for the field Client will be:

Fields in linked module

Prefill by

Clients.Client Name

Users.Client

With this rule we literally tell the system: “Prefill those client which name is equal to the client of the user selected in User field of the module Briefs”. 

Example for case 4

Each user has a role assigned to him. We want to prefill the users with a certain role (e.g. Client) in the User field of the module Briefs

image142.png

Prefilling rule for the field User will be:

Fields in linked module

Filter by

User.Role

STATIC VALUE

Client

With this rule we literally tell the system: “Prefill those users whose role is equal to the particular role specified in the prefilling rule”.

You can define several roles in configuration. In case the user also has several roles the prefilling will be done according to OR logic. In other words, all users who has at least one role matched will be candidates for prefilling. For single select User field the first user in the list that matches the role will be prefilled. For multi select field all users that match the role will be prefilled.

Note! The prefilling will not work in Export PDF window that saves the exported PDF to another module if the module link to be prefilled is hidden by field usage on form. This window uses another mechanism and requires the field to be present on the form for saving.