Use virtual objects in Creatio tools
This functionality is available for Creatio 10.2 and later.
You can select a virtual object in the Application Hub, Freedom UI Designer, Dashboard Designer, Freedom UI Mobile Designer, and Process Designer the same way as a regular object. When you select a virtual object, the tool shows a warning, for example, "The selected object is virtual. Make sure it supports all operations this page needs, or data may not display or save correctly." The warning text differs between the tools. Creatio shows the warning for every virtual object since the tool cannot check which operations the code of the object supports. Learn more about virtual objects: Virtual objects basics.
Each tool requires a specific set of operations from a virtual object. Find the tool you use and make sure that the virtual object supports the operations that the tool requires. To implement the operations, follow the instructions: Implement a virtual object.
Virtual object operations
A virtual object has no database table, so Creatio passes every operation to the code that the developer writes for the object. Whether a tool works correctly depends on the operations that the code supports. The following rules explain most issues with virtual objects:
- The query executor applies the whole query. The query includes the columns, filters, sort order, number of records to return and skip, or the total to calculate. Creatio does not filter or sort the records that the query executor returns and does not split the records into batches. Users see exactly these records.
- Changing and deleting a record starts with a read. Before changing or deleting a record, Creatio reads the record by ID using the query executor and processes every record that the query executor returns. If the query executor cannot find the record, Creatio has no record to save or delete. If the query executor ignores the condition on the ID and returns all records, saving a single record on a page overwrites all records, and deleting a single record deletes all records.
- A missing event listener method is not an error. If the event listener has no
OnInserting(),OnUpdating(), orOnDeleting()method, Creatio reports that the record is saved or deleted, but the data source does not change.
Each Creatio tool requires a specific set of operations. The following table lists the operations of a virtual object and how to implement each operation.
Operation | Description | Implementation |
|---|---|---|
Filtering records | Return only the records that match the query conditions. | Query executor |
Sorting records | Return the records in the requested order. | Query executor |
Loading records in batches | Return a limited number of records and skip the records of the previous batches. | Query executor |
Calculating totals | Return a single value instead of records: count, sum, average, minimum, or maximum. | Query executor |
Reading records by ID | Return the records that have the specified ID or IDs. Saving and deleting records requires this operation. | Query executor |
Adding records | Add a record to the data source. |
|
Changing records | Change a record in the data source. |
|
Deleting records | Delete a record from the data source. |
|
Operations required by Creatio tools
Application Hub
You can create an app for a virtual object using the Link to an existing object checkbox in the Advanced parameters block of the New application window. The app includes a list page and a form page and requires everything that the list and the form page require. Implement the operations listed in the table below to use a virtual object in the app.
Operation | Application Hub |
|---|---|
Filtering records | + |
Sorting records | + |
Loading records in batches | + |
Calculating totals | + |
Reading records by ID | + |
Adding records | + |
Changing records | + |
Deleting records | + |
The generated pages include buttons for every operation. If the event listener has no method for an operation, for example, the OnDeleting() method, users click the button, see no error, and the record stays in place. Remove such buttons from the generated pages.
Freedom UI Designer
You can select a virtual object in the Freedom UI Designer in the following cases:
- When you add the virtual object to a page as an existing data source in the element library.
- When you fill out the Object parameter in the setup area of a component, for example, the List, Gallery, or Calendar component.
- When you fill out the Object parameter in the setup area of a widget, for example, a list widget, metric, or pivot table. For a metric, this includes the comparison value and the elements of the formula.
Select the operations to implement based on the page data source, components, and widgets listed in the table below.
Operation | Page data source | Components | Widgets | ||||
|---|---|---|---|---|---|---|---|
List and Gallery | Calendar | Next best offers | List widget | Metrics | Pivot tables | ||
Filtering records | — | + | + | + | + | + | + |
Sorting records | — | + | + | + | + | — | — |
Loading records in batches | — | + | + | + | + | — | + |
Calculating totals | — | + | — | — | + (only for the counter of selected records) | + | — |
Reading records by ID | + | — | — | — | — | — | — |
Adding records | + | — | — | — | — | — | — |
Changing records | + | — | — | — | — | — | — |
Deleting records | + | — | — | — | — | — | — |
Page data source
If the data source of a form page is a virtual object, the page reads a single record and saves the record. Select the operations to implement based on the user actions listed in the table below. The table uses the "External invoice" (UsrExtInvoice code) virtual object as an example.
User action | Creatio actions | Required operations |
|---|---|---|
Click New | Populates the fields with the default values from the column settings. Does not call the code of the object. | None |
Save a new record |
| Adding records |
Open an external invoice | Queries the record whose ID matches the ID of the opened record, with the columns of the page fields. | Reading records by ID |
Change the Amount field and save the invoice |
| Reading records by ID, |
Copy a record |
| Reading records by ID, |
Delete a record on the page or in a list |
| Reading records by ID, |
If an operation is missing, the following issues occur:
- The
OnInserting()orOnUpdating()method is missing. The page reports a successful save, but the change is lost after the page is reopened. - Reading records by ID is missing. The page opens empty or shows another record.
- The
OnDeleting()method is missing. The record disappears from the list and appears again after a refresh.
List and Gallery components, list widget
The List and Gallery components and the list widget only read data. Every user action sends a new query to the query executor. Select the queries to support in the query executor based on the user actions listed in the table below. The table uses the "External invoice" (UsrExtInvoice code) virtual object that includes the "Name," "Amount," and "Owner" columns as an example. The "Owner" column is a "Lookup" type column that refers to contacts.
User action | Query content |
|---|---|
Open the page |
|
Scroll to the end of the loaded records |
|
Click a column header |
|
Enter text in the search field | Filters: a group of conditions joined by the
Depending on the "String columns filter" ( |
Set a quick filter |
|
Select records in the list |
Learn more: Metrics. |
Click Summaries on the list toolbar |
Learn more: Metrics. |
If an operation is missing, the following issues occur:
- Displayed values of "Lookup" type columns are missing. The "Owner" column is empty.
- Loading records in batches is missing. Scrolling loads the same 30 records again.
- Sorting is missing. A click on a column header changes nothing.
- Filtering is missing. The search and the quick filters change nothing, and users believe that the list is filtered.
Calendar component
The Calendar component reads records in batches of 150 records sorted by the start date. The visible period comes from a Date quick filter that is connected to the calendar. Select the queries to support in the query executor based on the user actions listed in the table below.
User action | Query content |
|---|---|
Open the calendar or change the visible period |
|
If an operation is missing, the calendar shows records outside the selected period or shows only the first 150 records.
Next best offers component
Select the queries to support in the query executor based on the user actions listed in the table below.
User action | Query content |
|---|---|
Open the page that includes the component |
|
Metrics
A metric does not read records. A metric queries a single total that Creatio calculates for the records that match the filter of the metric. Select the queries to support in the query executor based on the metric parameters listed in the table below.
Metric parameter | Query content |
|---|---|
The Function parameter is set to "Count" |
|
The Function parameter is set to "Sum," "Average," "Minimum," or "Maximum" |
|
The Compare with another value parameter is enabled |
|
The Function parameter is set to "Formula" |
|
The query has no sort order, and the RowCount and SkipRowCount properties are not set. The response is a single row that contains the value. If the page or quick filters filter the metric, the conditions are included in the same query.
If an operation is missing, the metric shows "0," shows an error, or shows a value that ignores the filter.
Pivot tables
A pivot table does not query totals. A pivot table reads the records in batches and calculates the totals in the browser. Select the queries to support in the query executor based on the user actions listed in the table below.
User action | Query content |
|---|---|
Open the page that includes the pivot table |
|
Group a date field by year, month, week, day, or hour | Columns: the parts of the date as separate calculated columns. Use such grouping only if the developer confirms that the query executor supports it. |
If loading records in batches is missing, Creatio counts the same records multiple times and the totals are too high.
Dashboard Designer
You can select a virtual object in the Dashboard Designer when you fill out the Object parameter in the setup area of a widget, for example, a list widget, metric, or pivot table. The widgets of a dashboard send the same queries as the widgets on a Freedom UI page. Select the operations to implement based on the widgets listed in the table below.
Operation | List widget | Metrics | Pivot tables |
|---|---|---|---|
Filtering records | + | + | + |
Sorting records | + | — | — |
Loading records in batches | + | — | + |
Calculating totals | + (only for the counter of selected records) | + | — |
Reading records by ID | — | — | — |
Adding records | — | — | — |
Changing records | — | — | — |
Deleting records | — | — | — |
Learn more about the queries of each widget: List and Gallery components, list widget, Metrics, Pivot tables.
Freedom UI Mobile Designer
You can select a virtual object in the Freedom UI Mobile Designer when you fill out the Object parameter of the List component. The List component shows the records in Creatio Mobile and reads the records the same way as the List component in the Freedom UI Designer. Learn more: List and Gallery components, list widget. Select the operations to implement based on the component listed in the table below.
Operation | List component |
|---|---|
Filtering records | + |
Sorting records | + |
Loading records in batches | + |
Calculating totals | — |
Reading records by ID | — |
Adding records | — |
Changing records | — |
Deleting records | — |
Process Designer
You can select a virtual object in the Read data, Add data, Modify data, and Delete data process elements. Each process element shows the warning under the property that specifies the object, for example, Which object to read data from?, in the setup area. Select the operations to implement based on the process elements listed in the table below.
Operation | "Read data" process element | "Add data" process element | "Modify data" process element | "Delete data" process element | |||
|---|---|---|---|---|---|---|---|
Read the first record in the selection | Read collection of records | Calculate function | Calculate the number of records | ||||
Filtering records | + | + | + | + | — | + | + |
Sorting records | + | + | — | — | — | — | — |
Loading records in batches | — | + | — | — | — | + | + |
Calculating totals | — | — | + | + | — | — | — |
Reading records by ID | — | — | — | — | — | + | + |
Adding records | — | — | — | — | + | — | — |
Changing records | — | — | — | — | — | + | — |
Deleting records | — | — | — | — | — | — | + |
A business process has no user who notices an empty list. If the code of the object does not support an operation that a process element requires, the process element stops the business process with an error or processes the wrong records.
Read data process element
The operations that the Read data process element requires depend on the value of the Which data read mode to use? property in the setup area. Select the queries to support in the query executor based on the property values listed in the table below.
Value of the "Which data read mode to use?" property | Query content | Issues if an operation is missing |
|---|---|---|
Read the first record in the selection |
|
|
Read collection of records |
| The collection includes records that do not match the filter or misses records. |
Calculate function |
| The process element fails, or the result is "0." |
Calculate the number of records |
| The process element fails, or the result is "0." |
Add data process element
The operations that the Add data process element requires depend on the What is the data adding mode? property in the setup area. Select the operations to implement based on the property values listed in the table below.
Value of the "What is the data adding mode?" property | Creatio actions | Required operations |
|---|---|---|
Add one record |
| Adding records |
Add selection |
| Filtering records, |
Modify data process element
The Modify data process element changes every record that matches the Modify all records that match condition property in the setup area. The process element changes the records in the following stages: finds the records, reads the found records in full, and saves each record. Select the operations to implement based on the stages listed in the table below.
Stage | Creatio actions | Required operations |
|---|---|---|
Find the records | Queries the records that match the condition using the query executor in batches of 10,000 records. If the query executor ignores a filter that it does not support, the query returns every record of the object, and the process element changes all records. The query executor must reject such a query with an error. | Filtering records, |
Read the found records in full | Reads the found records again with all columns, 100 records at a time, by a list of IDs. | Reading records by ID |
Save each record | Sets the new values in each record, saves the record, and calls the | Changing records |
Delete data process element
The Delete data process element deletes every record that matches the Delete all records that match condition property in the setup area. The process element deletes the records in the following stages: finds the records, reads the found records, and deletes each record. Select the operations to implement based on the stages listed in the table below.
Stage | Creatio actions | Required operations |
|---|---|---|
Find the records | Queries the records that match the condition using the query executor in batches. If the query executor ignores a filter that it does not support, the query returns every record of the object, and the process element deletes all records. The query executor must reject such a query with an error. | Filtering records, |
Read the found records | Reads the found records by a list of IDs. | Reading records by ID |
Delete each record | Deletes the records one by one and calls the | Deleting records |
Process elements that do not support virtual objects
You cannot select a virtual object in the following process elements and properties of the Process Designer:
- Auto-generated page process element.
- Change access rights process element.
- Find and merge duplicates process element.
- Signals, for example, the start signal of the Event sub-process process element and the Throw signal process element. Creatio does not start a business process by a signal of a virtual object.
- Process parameters.