Modules
Modules provide a way of storing data inside your namespace. All the data is local to the namespace and is not accessible from other namespaces. Without modules, your namespace has no memory nor anything to work with, so defining them is the next step when creating a new app. A simple namespace typically only contains a few modules, however their number and their complexity is not limited. Corteza CRM, for example, has over 35 modules with hundreds of fields.
For a better understanding we provide a corelation with database terminology, though no database knowledge is required to use this feature. * A module can be thought of as a table, as it provides some metadata, a set of attributes and a place to store related data, * a module field can be thought of as an attribute, as it provides a way of defining the shape of the data, * a record can be thought of as an entity, as it provides the actual data for the module.
Corteza Low Code supports fields with multiple value entries for the same record (see Editing module fields), so you might not need pivot tables. |
Guidelines
For a consistent experience across different namespaces and Corteza instances, we define a few general guidelines regarding module definitions:
- Module name
-
The module name should be in PascalCase with spaces allowed, it should be short and descriptive, with no special characters except for : (colon), - (dash), _ (underscore), / (forward slash) and \ (backwards slash). For example: Quote Line,
- Module handle
-
The module handle should be in snake_case, it should be short and descriptive, with no special characters. If provided, it must:
-
start with a character,
-
contain only characters, numbers, _ (underscore), - (dash) or . (dot),
-
end with a character or a number.
-
Create a new module
To create a new module firstly navigate to the administration panel and click on "Modules" in the navigation. This will open up an interface that provides a list of existing modules and a way to define new modules, by either:
-
Creating a module manually (see Manually creating a module),
-
importing modules from a file (see Importing modules).
Importing modules
At the moment, the import modules function is unable to preserve references, so these will have to be assured manually. |
This feature allows you to import one or multiple modules from a given .yaml file. This file can be defined either manually or exported from a different namespace.
-
Press the "Browse" button next to the "Import module(s)" section,
-
press the "Import" button that appears after the file is successfully added,
-
select the modules you wish to import and press the "Import" button on the bottom right corner of the modal window.
Manually creating a module
This feature allows you to quickly create a new module by hand, without the need of any data exports.
-
Specify a name for the module in the "Module name" field, under the "Create a new module" section,
-
press the "Create" button. This opens the module editor view.
Module fields
Guidelines
For a consistent experience across different namespaces and Corteza instances, we define a few general guidelines regarding module field definitions:
- Field name
-
The module field title should be in snake_case, it should be short and descriptive, with no special characters. Name must:
-
start with a character,
-
contain only characters, numbers, _ (underscore), - (dash) or . (dot),
-
end with a character or a number.
-
- Field title
-
The module field title doesn’t define any strict restriction, as it is shown to the user. The only requirement is that it should be as short as possible (maximum length of 64 characters).
- Type
-
When defining a field, a correct type should be used; for example "Email" when storing emails, "Number" when storing numbers, and so on.
Adding module fields
To add a new module field, click on the "Add new field" button. This will insert a new empty module field to the bottom of the list.
Editing module fields
Each module consists of a set of fields that define the shape of the stored data along with the type of data.
At the moment, module fields where the module already contains any records limits the module field editing capability. |
Each field defines the following properties:
-
Name: This defines the internal naming convention and it must be specified and unique. This is not shown to the end user. It must:
-
start with a character,
-
contain only characters, numbers, _ (underscore), - (dash) or . (dot),
-
end with a character or a number.
-
-
Title: This is a "human-friendly" representation of the field and is shown to the end-user when they view/edit the field. The title field doesn’t define strict restrictions, but is limited to the maximum of 64 characters,
-
Type: This defines what type of information this field represents. As is, the field defaults to the basic configuration for each specific field type. This can be edited by clicking on the wrench icon to the right of the dropdown.
-
Multi value: This checkbox allows us to store multiple entries of the same field for the given record.
-
Required: This makes the field mandatory for the end user when creating or editing a record.
-
Private: This allows you to mark data that is sensitive, such as name, email, or telephone number, so your namespace is compliant with privacy regulations such as the GDPR.
Field types
For a more structured system, we provide the following set of field types for you to chose from. By pressing on the wrench icon, you are able to provide additional configuration for the module field.
-
Checkbox (Y/N): This field shows a checkbox to the end user when editing a record. When you click on the wrench icon, you can select what checked and unchecked represent. For example: Yes/No, Active/Inactive, etc.
-
Date and time: Date time input field. You can configure:
-
Date only to omit the time part and only use the date,
-
Time only to omit the date part and only use the time,
-
Past values only to only allow past values,
-
Future value only to only allow future values,
-
Output relative value to show the value relative to now,
-
Custom output format to allow custom output date format.
-
-
Email: Email input field. Automatically performs email validation and creates a clickable link when viewing the value (can be disabled). This field auto-validates whether the input is an email and turns it into a clickable email link in record-viewing mode. You can configure:
-
Don’t turn email into a link to keep the email as plain text
-
-
Select / dropdown: Dropdown value select input. Forces the users to use one of the specified values. You can configure:
-
Options to add as many select options as you wish. You must provide both the value (left input) and the label (right input). Value represents the data storage, and label represents the display,
-
Multiple value input type to determine how multiple values are selected.
-
-
Number: Number value input. Automatically performs number validation and allows only numbers to be inserted. You can configure:
-
Prefix to specify the number’s prefix, such as $,
-
suffix to specify the number’s suffix, such as USD/h,
-
precision to specify the precision the number is stored with,
-
format to specify the numbers display format.
-
-
Record: Provides a way of cross-linking different records to define a complex structure. It renders a searchable select field. You can configure:
-
Module to specify what module this field will be linked to,
-
record label field to specify what field should be used when showing the linked record,
-
query fields on search to specify the fields that should be included in the search,
-
prefilter records to specify the pre-filtering.
-
-
String: Provides a text input field. You can configure:
-
Multi line to specify that the value can span over multiple lines,
-
use rich text editor to use the rich text editor instead of the simple plain text editor.
-
-
URL: Provides an URL input field. Automatically performs URL validation and creates a clickable link when viewing the value (can be configured). You can configure:
-
Trim # from the URL to specify that the hash should be ignored,
-
Trim ? from the URL to specify that the query should be ignored,
-
Only allow SSL (HTTPS) URLs to specify that only secure URL’s can be provided,
-
Don’t turn URL into a link to keep the URL as a plain text value.
-
-
User: Provides a searchable dropdown select. This field references all users in Corteza. You can configure:
-
Preset with current user to default to the user that created/updated the record,
-
Multiple value input type to determine how multiple values are selected.
-
-
File upload: This creates a File Upload input. You can configure:
-
Veiw mode to specify how the files are presented when viewing the value.
-
See Moment.js format for available date time formatting. |
See Numeral.js format for available number formatting. |