Skip to main content
Version: 10

Manage orders stored in an external system

Level: advanced
note

This functionality is available for Creatio 10.2 and later.

To implement the example:

  1. Set up the external service. Read more >>>
  2. Create a virtual object. Read more >>>
  3. Implement an API client. Read more >>>
  4. Implement a query executor. Read more >>>
  5. Implement an event listener. Read more >>>
  6. Create the app. Read more >>>
  7. Set up the business process that marks an order as reviewed. Read more >>>
  8. Set up the app pages. Read more >>>
Example

Show the orders of an external order management system in the External orders section without copying the orders to Creatio. Users must be able to do the following:

  • view orders

  • add orders

  • search orders

  • change orders

  • delete orders

  • save the changes in the external system

Add a Mark as reviewed button to the order page that adds the "Reviewed by a business process" note to the order using a business process.

The code supports only the queries that the example pages send. Before you use the code in a production app, add the filters, sort columns, error handling, and access checks that the app requires.

1. Set up the external service​

The example uses a demo external REST service that stores orders at the https://creatio-sdk-examples.onrender.com/api/orders URL. The service stores up to 500 orders and restores the demo orders every 24 hours. The first request after a period of inactivity can take up to a minute.

To use your own service:

  1. Deploy a service that implements the contract described below.

    The service must meet the following requirements:

    • Accepts and returns data in the JSON format.
    • Does not require authentication. The example API client sends requests without authentication.
  2. Change the URL in the BaseUrl constant of the API client. The Creatio application server must have access to the service.

  3. If you use Creatio in the cloud, publish the service on the internet.

The following table lists the fields of an order that the service stores.

Field

Type

Description

id

Guid

Order ID. Matches the ID of the Creatio record.

number

String

Order number. The service generates the number.

name

String

Order name.

amount

Decimal

Order amount.

orderDate

DateTime

Order date. Can be empty.

notes

String

Order notes.

createdOn

DateTime

Date and time of the order creation.

modifiedOn

DateTime

Date and time of the last order modification.

The following JSON shows an example of an order.

Example of an order
{
"id": "{Order ID}",
"number": "ORD-0001",
"name": "Office chairs",
"amount": 1250.50,
"orderDate": "2026-11-30T00:00:00",
"notes": "Deliver to the main office",
"createdOn": "2026-11-30T10:15:00",
"modifiedOn": "2026-11-30T10:15:00"
}

The following table lists the endpoints that the service must implement.

Request

Description

GET /api/orders

Returns an array of orders.

Parameters

Parameter

Type

Description

search

String

Text to search in the order number, name, and notes.

orderBy

String

Field that determines the sort order of the orders.

Available values

Value

Description

number

Order number.

name

Order name.

amount

Order amount.

orderDate

Order date.

direction

String

Sort direction.

Available values

Value

Description

asc

Ascending order.

desc

Descending order.

skip

Integer

Number of orders to skip.

take

Integer

Number of orders to return. If the value is "0," the service returns all orders.

GET /api/orders/{id}

Returns the order that has the specified ID. If the order does not exist, returns the 404 Not Found HTTP status code.

POST /api/orders

Creates an order. The request body includes the ID that Creatio generates for the record. The service generates the order number and returns the created order.

PUT /api/orders/{id}

Replaces all fields of the order that has the specified ID.

DELETE /api/orders/{id}

Deletes the order that has the specified ID. If the order does not exist, returns the 404 Not Found HTTP status code.

As a result, the GET https://creatio-sdk-examples.onrender.com/api/orders?take=0 request returns the array of demo orders.

2. Create a virtual object​

  1. Open the Configuration section. Instructions: Open the Configuration section.

  2. Create a sdkVirtualObject package. Instructions: Create a package.

    When you create the package, clear the Compile into a separate assembly checkbox.

  3. Add the CrtProductBase package as a package dependency. Instructions: Set up the package dependencies.

  4. Change the current package to sdkVirtualObject. Instructions: Change the current package.

  5. Click Add → Object.

  6. Fill out the schema properties.

    Property

    Value

    General property block

    Code

    UsrExtOrder

    Title

    External order

    Inheritance property block

    Parent object

    BaseEntity

    Behavior property block

    Virtual

    Select the checkbox

  7. Add columns.

    Column

    Type

    Property

    Value

    Column that contains the order number

    Text (50 characters)

    Code

    UsrNumber

    Title

    Number

    Column that contains the order name

    Text (250 characters)

    Code

    UsrName

    Title

    Name

    Required

    Yes

    Column that contains the order amount

    Decimal (0.01)

    Code

    UsrAmount

    Title

    Amount

    Column that contains the order date

    Date

    Code

    UsrOrderDate

    Title

    Order date

    Column that contains the order notes

    Text (500 characters)

    Code

    UsrNotes

    Title

    Notes

  8. Set the "Displayed value" property in the Object settings property block to "Name."

  9. Click Save and publish.

As a result, Creatio adds the "External order" (UsrExtOrder code) virtual object to the sdkVirtualObject package. Creatio does not create a database table for the object.

3. Implement an API client​

The API client sends requests to the external service and hides HTTP details from the query executor and the event listener.

To implement the API client:

  1. Click Add → Source code.

  2. Fill out the schema properties.

    Property

    Value

    Code

    UsrExtOrdersApiClient

    Title

    External orders API client

  3. Click Apply.

  4. Add the source code.

    UsrExtOrdersApiClient
    namespace Terrasoft.Configuration
    {
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Http;
    using System.Text;
    using Newtonsoft.Json;

    /* Order that the external service returns. */
    public class UsrExtOrderDto
    {
    public Guid Id { get; set; }
    public string Number { get; set; }
    public string Name { get; set; }
    public decimal Amount { get; set; }
    public DateTime? OrderDate { get; set; }
    public string Notes { get; set; }
    public DateTime CreatedOn { get; set; }
    public DateTime ModifiedOn { get; set; }
    }

    /* Order that Creatio sends to the external service. */
    public class UsrExtOrderSaveDto
    {
    public Guid Id { get; set; }
    public string Number { get; set; }
    public string Name { get; set; }
    public decimal Amount { get; set; }
    public DateTime? OrderDate { get; set; }
    public string Notes { get; set; }
    }

    /* Client that sends requests to the external service. */
    public class UsrExtOrdersApiClient
    {
    /* URL of the demo external service. */
    private const string BaseUrl =
    "https://creatio-sdk-examples.onrender.com/api/orders";

    private static readonly HttpClient HttpClient =
    new HttpClient();

    /* Retrieve a page of orders that match the search text. */
    public List<UsrExtOrderDto> GetOrders(string search,
    string orderBy, string direction, int skip, int take) {
    string url = $"{BaseUrl}?search=" +
    $"{Uri.EscapeDataString(search ?? string.Empty)}" +
    $"&orderBy={orderBy}&direction={direction}" +
    $"&skip={skip}&take={take}";
    HttpResponseMessage response =
    Send(HttpMethod.Get, url, null);
    return Read<List<UsrExtOrderDto>>(response);
    }

    /* Retrieve the order by ID. Return null if the order is missing. */
    public UsrExtOrderDto GetOrder(Guid id) {
    HttpResponseMessage response =
    Send(HttpMethod.Get, $"{BaseUrl}/{id}", null);
    if (response.StatusCode == HttpStatusCode.NotFound) {
    return null;
    }
    return Read<UsrExtOrderDto>(response);
    }

    /* Create the order and return the order that the service saved. */
    public UsrExtOrderDto CreateOrder(UsrExtOrderSaveDto order) {
    HttpResponseMessage response =
    Send(HttpMethod.Post, BaseUrl, order);
    return Read<UsrExtOrderDto>(response);
    }

    /* Replace all fields of the order. */
    public void UpdateOrder(Guid id, UsrExtOrderSaveDto order) {
    HttpResponseMessage response =
    Send(HttpMethod.Put, $"{BaseUrl}/{id}", order);
    EnsureSuccess(response);
    }

    /* Delete the order. Skip the order if the service cannot find it. */
    public void DeleteOrder(Guid id) {
    HttpResponseMessage response =
    Send(HttpMethod.Delete, $"{BaseUrl}/{id}", null);
    if (response.StatusCode == HttpStatusCode.NotFound) {
    return;
    }
    EnsureSuccess(response);
    }

    /* Send the request and serialize the request body to JSON. */
    private static HttpResponseMessage Send(HttpMethod method,
    string url, object body) {
    var request = new HttpRequestMessage(method, url);
    if (body != null) {
    string json = JsonConvert.SerializeObject(body);
    request.Content = new StringContent(json,
    Encoding.UTF8, "application/json");
    }
    return HttpClient.SendAsync(request)
    .GetAwaiter().GetResult();
    }

    /* Check the response and deserialize the response body. */
    private static T Read<T>(HttpResponseMessage response) {
    EnsureSuccess(response);
    string json = response.Content.ReadAsStringAsync()
    .GetAwaiter().GetResult();
    return JsonConvert.DeserializeObject<T>(json);
    }

    /* Throw an exception if the service returns an error.
    * The user sees the exception message. Creatio shortens a long
    * message, so write a short and clear message. The example
    * message contains the whole response of the service, so the
    * user sees technical details. */
    private static void EnsureSuccess(
    HttpResponseMessage response) {
    if (response.IsSuccessStatusCode) {
    return;
    }
    string error = response.Content.ReadAsStringAsync()
    .GetAwaiter().GetResult();
    throw new InvalidOperationException(
    "External orders API returned " +
    $"{(int)response.StatusCode}: {error}");
    }
    }
    }
  5. Click Save and publish.

As a result, Creatio adds the UsrExtOrdersApiClient class that sends requests to the external service.

4. Implement a query executor​

Creatio finds the query executor by name. The name in the DefaultBinding attribute must consist of the object code and the QueryExecutor suffix. The name is case-sensitive. Learn more about the query executor rules: Implement a query executor.

To implement the query executor:

  1. Click Add → Source code.

  2. Fill out the schema properties.

    Property

    Value

    Code

    UsrExtOrderQueryExecutor

    Title

    External order query executor

  3. Click Apply.

  4. Add the source code.

    UsrExtOrderQueryExecutor
    namespace Terrasoft.Configuration
    {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Terrasoft.Common;
    using Terrasoft.Core;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Factories;

    /* Creatio finds the query executor by the binding name. */
    [DefaultBinding(typeof(IEntityQueryExecutor),
    Name = "UsrExtOrderQueryExecutor")]
    public class UsrExtOrderQueryExecutor : IEntityQueryExecutor
    {
    private readonly UserConnection _userConnection;

    private readonly UsrExtOrdersApiClient _apiClient =
    new UsrExtOrdersApiClient();

    public UsrExtOrderQueryExecutor(
    UserConnection userConnection) {
    _userConnection = userConnection;
    }

    /* Creatio calls the method for every read of "UsrExtOrder."
    * For example, to show the list or the form page.
    * Creatio also reads the record by ID before a save or a delete. */
    public EntityCollection GetEntityCollection(
    EntitySchemaQuery esq) {
    /* Find the filters that the example supports. */
    EntitySchemaQueryFilter idFilter = FindIdFilter(esq);
    EntitySchemaQueryFilterCollection searchFilter =
    FindSearchFilter(esq);
    CheckNoOtherFilters(esq, idFilter, searchFilter);
    /* Read the orders by ID or read a page of orders. */
    List<UsrExtOrderDto> orders = idFilter != null
    ? GetOrdersByIds(idFilter)
    : GetOrdersPage(esq, searchFilter);
    /* Creatio does not filter or sort the collection and does not split it into batches.
    * The list and the form page show the records as they are. */
    var collection =
    new EntityCollection(_userConnection, esq.RootSchema);
    foreach (UsrExtOrderDto order in orders) {
    collection.Add(ToEntity(esq.RootSchema, order));
    }
    /* A count or a summary requests a single record.
    * The record contains the aggregated values. */
    if (esq.Columns.Any(column =>
    column.ValueExpression.IsAggregationFunction)) {
    return GetAggregates(esq, collection);
    }
    return collection;
    }

    private EntityCollection GetAggregates(EntitySchemaQuery esq,
    EntityCollection records) {
    /* The query schema has a column for every aggregated value.
    * The column name matches the name of the query column. */
    EntitySchema querySchema = esq.GetSchema();
    Entity result = querySchema.CreateEntity(_userConnection);
    foreach (EntitySchemaQueryColumn column in esq.Columns
    .Where(column =>
    column.ValueExpression.IsAggregationFunction)) {
    var function = (EntitySchemaAggregationQueryFunction)
    column.ValueExpression.Function;
    result.LoadColumnValue(column.Name,
    Aggregate(function, records));
    }
    var collection =
    new EntityCollection(_userConnection, querySchema);
    collection.Add(result);
    return collection;
    }

    /* Calculate the aggregated value for the returned orders. */
    private static object Aggregate(
    EntitySchemaAggregationQueryFunction function,
    EntityCollection records) {
    if (function.AggregationType ==
    AggregationTypeStrict.Count) {
    return records.Count;
    }
    List<object> values = records
    .Select(record => record.GetColumnValue(
    function.Expression.Path))
    .Where(value => value != null)
    .ToList();
    switch (function.AggregationType) {
    case AggregationTypeStrict.Sum:
    return values.Sum(
    value => Convert.ToDecimal(value));
    case AggregationTypeStrict.Avg:
    return values.Count == 0
    ? null
    : (object)values.Average(
    value => Convert.ToDecimal(value));
    case AggregationTypeStrict.Min:
    return values.Min();
    case AggregationTypeStrict.Max:
    return values.Max();
    default:
    throw new NotSupportedException(
    "UsrExtOrder does not support " +
    $"{function.AggregationType}.");
    }
    }

    private static IEnumerable<IEntitySchemaQueryFilterItem>
    GetEnabledFilters(EntitySchemaQuery esq) {
    return GetEnabledFilters(esq.Filters);
    }

    /* Business process elements send conditions in an AND group.
    * Read the filters of AND groups as top-level filters. */
    private static IEnumerable<IEntitySchemaQueryFilterItem>
    GetEnabledFilters(
    EntitySchemaQueryFilterCollection filters) {
    foreach (IEntitySchemaQueryFilterItem filter in
    filters.Where(item => item.IsEnabled)) {
    var group =
    filter as EntitySchemaQueryFilterCollection;
    if (group != null && group.LogicalOperation ==
    LogicalOperationStrict.And) {
    foreach (IEntitySchemaQueryFilterItem innerFilter
    in GetEnabledFilters(group)) {
    yield return innerFilter;
    }
    } else {
    yield return filter;
    }
    }
    }

    /* Find the "Id = {value}" filter. */
    private static EntitySchemaQueryFilter FindIdFilter(
    EntitySchemaQuery esq) {
    return GetEnabledFilters(esq)
    .OfType<EntitySchemaQueryFilter>()
    .FirstOrDefault(filter =>
    filter.LeftExpression?.Path == "Id" &&
    filter.ComparisonType ==
    FilterComparisonType.Equal);
    }

    /* Find the OR group of filters that the list search sends. */
    private static EntitySchemaQueryFilterCollection
    FindSearchFilter(EntitySchemaQuery esq) {
    return GetEnabledFilters(esq)
    .OfType<EntitySchemaQueryFilterCollection>()
    .FirstOrDefault(group =>
    group.LogicalOperation ==
    LogicalOperationStrict.Or &&
    group.Any(IsTextSearchFilter) &&
    group.All(IsSearchFilter));
    }

    /* The list search compares text columns using "Contain" or
    * "StartWith." If the search text is a number, the search also
    * compares number columns using "Equal." The example sends
    * only the text to the external service. */
    private static bool IsSearchFilter(
    IEntitySchemaQueryFilterItem item) {
    var filter = item as EntitySchemaQueryFilter;
    return IsTextSearchFilter(item) || filter?.ComparisonType ==
    FilterComparisonType.Equal;
    }

    private static bool IsTextSearchFilter(
    IEntitySchemaQueryFilterItem item) {
    var filter = item as EntitySchemaQueryFilter;
    return filter != null && (filter.ComparisonType ==
    FilterComparisonType.Contain || filter.ComparisonType ==
    FilterComparisonType.StartWith);
    }

    /* Throw an exception for filters that the example does not support.
    * A query executor can support any filters that its data source
    * handles. */
    private static void CheckNoOtherFilters(
    EntitySchemaQuery esq,
    IEntitySchemaQueryFilterItem idFilter,
    IEntitySchemaQueryFilterItem searchFilter) {
    bool hasOtherFilters = GetEnabledFilters(esq)
    .Any(filter => filter != idFilter &&
    filter != searchFilter);
    if (hasOtherFilters) {
    throw new NotSupportedException(
    "UsrExtOrder supports only the filter by Id " +
    "and the list search.");
    }
    }

    private List<UsrExtOrderDto> GetOrdersByIds(
    EntitySchemaQueryFilter idFilter) {
    var orders = new List<UsrExtOrderDto>();
    foreach (EntitySchemaQueryExpression value in
    idFilter.RightExpressions) {
    /* A delete from the list sends the IDs as strings. */
    Guid id = Guid.Parse(value.ParameterValue.ToString());
    UsrExtOrderDto order = _apiClient.GetOrder(id);
    if (order != null) {
    orders.Add(order);
    }
    }
    return orders;
    }

    private List<UsrExtOrderDto> GetOrdersPage(
    EntitySchemaQuery esq,
    EntitySchemaQueryFilterCollection searchFilter) {
    EntitySchemaQueryColumn sortColumn = esq.Columns
    .FirstOrDefault(column =>
    column.OrderDirection != OrderDirection.None);
    string orderBy = GetApiFieldName(sortColumn);
    string direction = sortColumn?.OrderDirection ==
    OrderDirection.Descending ? "desc" : "asc";
    string search = GetSearchText(searchFilter);
    /* Skip SkipRowCount orders and return RowCount orders.
    * RowCount is -1 if Creatio needs all records.
    * The service returns all orders if take is 0. */
    int take = esq.RowCount > 0 ? esq.RowCount : 0;
    return _apiClient.GetOrders(search, orderBy, direction,
    esq.SkipRowCount, take);
    }

    /* Retrieve the search text from the first text filter. */
    private static string GetSearchText(
    EntitySchemaQueryFilterCollection searchFilter) {
    if (searchFilter == null) {
    return null;
    }
    var textFilter = (EntitySchemaQueryFilter)searchFilter
    .First(IsTextSearchFilter);
    return (string)textFilter.RightExpressions[0]
    .ParameterValue;
    }

    /* Map the sort column to the field of the external service. */
    private static string GetApiFieldName(
    EntitySchemaQueryColumn column) {
    switch (column?.ValueExpression?.Path) {
    case "UsrName":
    return "name";
    case "UsrAmount":
    return "amount";
    case "UsrOrderDate":
    return "orderDate";
    default:
    return "number";
    }
    }

    /* Convert the order to the "UsrExtOrder" object record. */
    private Entity ToEntity(EntitySchema schema,
    UsrExtOrderDto order) {
    Entity entity = schema.CreateEntity(_userConnection);
    /* Load the values without marking the columns as changed.
    * Return the same ID on every read.
    * Creatio uses the ID to open, save, and delete the record. */
    entity.LoadColumnValue("Id", order.Id);
    entity.LoadColumnValue("UsrNumber", order.Number);
    entity.LoadColumnValue("UsrName", order.Name);
    entity.LoadColumnValue("UsrAmount", order.Amount);
    entity.LoadColumnValue("UsrOrderDate", order.OrderDate);
    entity.LoadColumnValue("UsrNotes",
    order.Notes ?? string.Empty);
    entity.LoadColumnValue("CreatedOn", order.CreatedOn);
    entity.LoadColumnValue("ModifiedOn", order.ModifiedOn);
    return entity;
    }
    }
    }
  5. Click Save and publish.

As a result, Creatio adds the UsrExtOrderQueryExecutor class that returns the records of the "External order" (UsrExtOrder code) object. Users see exactly the records that the query executor returns. Creatio does not add, remove, or reorder records after the query executor. The list shows the orders in the order that the external service returns them.

The query executor works as follows:

  • If a user selects a filter in the Filters toggle panel or a tag in the Tag field, the list shows no records and an error message. The example supports only the query by ID and the list search.
  • The list search compares text columns using the Contain or StartWith comparison type, depending on the "String columns filter" (StringColumnSearchComparisonType code) system setting. Out of the box, the value is set to "1," and the list search uses the Contain comparison type. If the value is set to "0," the list search uses the StartWith comparison type. If the search text is a number, the list search also compares number columns using the Equal comparison type. The example sends only the text to the service. For example, a search for "100" finds orders whose number, name, or notes contain "100," not orders whose amount is 100.
  • The query executor calculates the count and the totals for the returned orders. The list uses them when a user selects all records using the checkbox in the list header or views the totals of list columns using the Summaries button on the list toolbar.

5. Implement an event listener​

Learn more about the event listener rules: Implement an event listener.

To implement the event listener:

  1. Click Add → Source code.

  2. Fill out the schema properties.

    Property

    Value

    Code

    UsrExtOrderEventListener

    Title

    External order event listener

  3. Click Apply.

  4. Add the source code.

    UsrExtOrderEventListener
    namespace Terrasoft.Configuration
    {
    using System;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Entities.Events;

    /* Listen to the events of the "UsrExtOrder" object. */
    [EntityEventListener(SchemaName = "UsrExtOrder")]
    public class UsrExtOrderEventListener : BaseEntityEventListener
    {
    /* Creatio writes nothing to the database for a new record.
    * Create the order in the external service.
    * The save does not return the generated number to the page.
    * The list reads the order again and shows the number. */
    public override void OnInserting(object sender,
    EntityBeforeEventArgs e) {
    base.OnInserting(sender, e);
    var entity = (Entity)sender;
    UsrExtOrderDto createdOrder = new UsrExtOrdersApiClient()
    .CreateOrder(ToOrder(entity));
    /* Keep the generated number for the code after the event. */
    entity.SetColumnValue("UsrNumber", createdOrder.Number);
    }

    /* Send all fields of the changed order to the external service.
    * The service replaces the whole order.
    * If the service returns an error, the client throws an exception.
    * Creatio stops the save and shows the exception message.
    * The form page keeps the changes of the user. */
    public override void OnUpdating(object sender,
    EntityBeforeEventArgs e) {
    base.OnUpdating(sender, e);
    var entity = (Entity)sender;
    new UsrExtOrdersApiClient().UpdateOrder(
    entity.PrimaryColumnValue, ToOrder(entity));
    }

    /* Creatio deletes nothing in the database for a deleted record.
    * Delete the order in the external service.
    * If the service does not find the order, the delete succeeds. */
    public override void OnDeleting(object sender,
    EntityBeforeEventArgs e) {
    base.OnDeleting(sender, e);
    var entity = (Entity)sender;
    new UsrExtOrdersApiClient()
    .DeleteOrder(entity.PrimaryColumnValue);
    }

    /* Convert the record to the order for the external service. */
    private static UsrExtOrderSaveDto ToOrder(Entity entity) {
    return new UsrExtOrderSaveDto {
    Id = entity.PrimaryColumnValue,
    Number = entity.GetTypedColumnValue<string>(
    "UsrNumber"),
    Name = entity.GetTypedColumnValue<string>("UsrName"),
    Amount = entity.GetTypedColumnValue<decimal>(
    "UsrAmount"),
    OrderDate =
    (DateTime?)entity.GetColumnValue("UsrOrderDate"),
    Notes = entity.GetTypedColumnValue<string>("UsrNotes")
    };
    }
    }
    }
  5. Click Save and publish.

  6. Click Compile in the Configuration section.

  7. For Creatio on .NET, restart Creatio. Creatio on .NET Framework restarts after the compilation automatically. Creatio loads the query executor and the event listener only when Creatio starts.

As a result, Creatio adds the UsrExtOrderEventListener class that saves the changes of the "External order" (UsrExtOrder code) object records in the external service.

The event listener works as follows:

  • After a user adds an order, the list shows the order number that the external service generates.
  • If the external service returns an error, Creatio does not save the record and shows the error message. The form page keeps the changes of the user.

6. Create the app​

Create the External orders app based on the Records & business processes template. Instructions: Create an app manually (user documentation).

When you create the app:

  1. Clear the "Create pages for the mobile app" checkbox.
  2. Select the "Link to an existing object" checkbox in the Advanced parameters block.
  3. Set the "Object" property to "External order." This shows the "The selected object is virtual. Make sure it supports all the operations the app needs, or app pages might not display or save data" warning.

As a result, Creatio creates the External orders app that includes the list page and the form page of the "External order" (UsrExtOrder code) object.

7. Set up the business process that marks an order as reviewed​

  1. Create a business process.

    1. Open the External orders app in the Application Designer.

    2. Go to the Business processes tab.

    3. Click New process.

    4. Fill out the schema properties.

      Property

      Value

      Title

      Mark order as reviewed

      Code

      UsrMarkOrderAsReviewed

    5. Click Save.

  2. Add the business process parameter.

    1. Click an arbitrary place in the working area.

    2. Open the Parameters tab.

    3. Click Add parameter → Other → Unique identifier.

    4. Fill out the parameter properties.

      Property

      Value

      Title

      Order Id

      Code

      OrderId

    5. Click Save.

  3. Set up the "Modify data" element.

    1. Place the Modify data element between the Simple start event and the Terminate end event in the working area.

    2. Fill out the element properties.

      Property

      Value

      Title

      Mark the order as reviewed

      Which object to modify data of?

      External order

      Modify all records that match condition

      1. Click Add condition. This opens the Select column window.
      2. Select "Id" in the Column property.
      3. Click Select.
      4. Select Compare with Parameter. This opens the Select parameter window.
      5. Open the Process parameters tab.
      6. Click Order Id.
      7. Click Select.

      Which column values to set for modified records?

      1. Click Add field. This opens the Select columns window.
      2. Select the Notes checkbox.
      3. Click Save.
      4. Enter "Reviewed by a business process."

      This shows the "The selected object is virtual. Make sure it supports all operations this element needs, or the process might fail" warning.

    3. Click Save.

  4. Click Save.

As a result, Creatio adds the "Mark order as reviewed" business process that sets the Notes field of the order.

8. Set up the app pages​

  1. Set up the list page.

    1. Open the External orders list page in the Freedom UI Designer.
    2. Select the List component on the canvas. This shows the "The selected object is virtual. Make sure it supports all operations this page needs, or data may not display or save correctly" warning in the setup area.
    3. Click btn_add.png. This opens the Select field window.
    4. Select the Number, Amount, and Order date checkboxes.
    5. Click Select.
    6. Click btn_open_properties.png → Hide for the "Created on" column.
    7. Click btn_open_properties.png → Hide for the "Created by" column.
    8. Click Save.
  2. Set up the form page.

    1. Open the External orders form page in the Freedom UI Designer.

    2. Drag the Number, Amount, Order date, and Notes fields from the Data model attributes group of the element library to the canvas.

    3. Fill out the field parameters.

      Element

      Parameter

      Value

      Field that contains the order number

      Title

      Number

      Read-only

      Select the checkbox

      Element code

      UsrNumberInput

      Field that contains the order amount

      Title

      Amount

      Element code

      UsrAmountInput

      Field that contains the order date

      Title

      Order date

      Element code

      UsrOrderDateInput

      Field that contains the order notes

      Title

      Notes

      Multiline text

      Select the checkbox

      Element code

      UsrNotesInput

    4. Drag the Button component to the canvas.

    5. Fill out the component parameters.

      Element

      Parameter

      Value

      Button that runs the "Mark order as reviewed" business process

      Title

      Mark as reviewed

      Style

      Focus

      Action

      Run process

      Which process to run?

      Mark order as reviewed

      How to run the process?

      For the selected page

      Process parameter where the record is passed

      Order Id

      Element code

      UsrMarkAsReviewedButton

    6. Click Save.

      Creatio runs the business process as follows:

      1. The button runs the business process and passes the record ID to the OrderId parameter.
      2. The Modify data element queries the record that has this ID. The query executor receives the "Id = OrderId" condition and reads the order from the external service.
      3. The Modify data element sets the Notes field and saves the record. The event listener sends the order to the external service using the PUT request.

As a result, the list page and the form page of the External orders app show the columns of the "External order" (UsrExtOrder code) object. The form page includes the Mark as reviewed button.

View the result​

The External orders section shows the orders that the external service returns. The demo service stores five demo orders. View the result >>>

To add an order:

  1. Open the "External orders" section.

  2. Click New.

  3. Fill out the order fields.

    Field

    Value

    Name

    Office chairs

    Amount

    1250.50

    Order date

    11/30/2026

    Notes

    Deliver to the main office

  4. Click Save.

As a result, the external service creates the order and generates the order number. The list shows the "Office chairs" order and its number. View the result >>>

To find an order, enter "chair" in the search field of the section.

As a result, the query executor sends the search text to the external service. The list shows the "Office chairs" order. View the result >>>

To change an order:

  1. Open the "Office chairs" order.
  2. Set the "Amount" field to "1400.00."
  3. Click Save.

As a result, the event listener sends the changed order to the external service. The list shows "1400.00" in the "Amount" column of the "Office chairs" order. View the result >>>

To mark an order as reviewed:

  1. Open the "Office chairs" order.
  2. Click "Mark as reviewed". Creatio shows the "The action has successfully started" message.
  3. Refresh the page.

As a result, the Notes field of the "Office chairs" order shows "Reviewed by a business process." View the result >>>

To delete an order, click btn_open_properties.png → Delete for the "Office chairs" order.

As a result, the event listener deletes the order in the external service. The list no longer shows the "Office chairs" order. View the result >>>


Resources​

Package with example implementation (virtual object, API client, query executor, and event listener)

Package with example implementation (Freedom UI app)