Hi,

is there any documentation on how to use the File param type in a business process? I wasn't able to find any.

I have a use case where i have to save a file as an attachment to an entity, starting from a base64 rappresentation of the file. I would like to accomplish this task with the least amount of coding. What i envisioned is a business process with a script task that converts the base64 to a File param. Then a process file shape that saves the File param. Sadly i'm dead in the water on how to implement this scenario because i have no idea on how to use File param type. I can't even understand what .Net/Terrasoft type it is. Do you have any suggestion?

Like 0

Like

1 comments

Hello,

Please specify if you have checked the available basic functionality meant for processing files within business processes - the "Process File" element? If so, could you describe why exactly does this option not work for you?

https://academy.creatio.com/docs/8.x/no-code-customization/bpm-tools/pr…

Show all comments

Hello all,

Is it possible in Freedom UI to add folders to sections other than Contacts? We need to enable static folders in the Knowledge Base.

Like 0

Like

0 comments
Show all comments

Hi all,

i'm trying to setup a backend system able to send push notification to mobile app (not developed in creatio) through FCM rest API.

The first hurdle is obtaining a valid token to authenticate to notification api exposed by firebase. In order to obtain this token i do have to call another rest api passing a jwt token generated by me and signed by a private key downloaded from fcm.

I've got a code (pasted below) that manages to generate this encrypted token and it's working in visual studio. But if i try to use it in a script task i got the exception 

'RSA' does not contain a definition for 'ImportPkcs8PrivateKey' and no accessible extension method 'ImportPkcs8PrivateKey' accepting a first argument of type 'RSA' could be found (are you missing a using directive or an assembly reference?)

As far as i know this exception is thrown if .net core being used is version 5 or below. But i'm on a demo instance with creation 8.2.0.4183 which should be already using net core 6 right?

Do you have any suggestion? (the flow is already configured to import System.Security.Cryptography)

 

 

--code--

   var now = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
var header = new Dictionary
       {
           { "alg", "RS256" },
           { "typ", "JWT" }
       };
string headerJson = JsonConvert.SerializeObject(header);
string encodedHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(headerJson)).TrimEnd('=').Replace('+', '-').Replace('/', '_');

var payload = new Dictionary
       {
           { "iss", CLIENT_EMAIL },
           { "scope", SCOPE },
           { "aud", TOKEN_URI },
           { "iat", now },
           { "exp", now + 3600 }
       };
string payloadJson = JsonConvert.SerializeObject(payload);
string encodedPayload = Convert.ToBase64String(Encoding.UTF8.GetBytes(payloadJson)).TrimEnd('=').Replace('+', '-').Replace('/', '_');
string unsignedJwt = $"{encodedHeader}.{encodedPayload}";
byte[] dataBytes = Encoding.UTF8.GetBytes(unsignedJwt);

// Decode PEM -> PKCS#8 bytes
string cleanKey = PRIVATE_KEY
   .Replace("-----BEGIN PRIVATE KEY-----", "")
   .Replace("-----END PRIVATE KEY-----", "")
   .Replace("\\n", "\n")  // ← decodifica reale da stringa JSON
   .Trim();


byte[] privateKeyBytes = Convert.FromBase64String(cleanKey);

// Firma con RSA-SHA256
byte[] signature;
using (var rsa = RSA.Create())
{
   rsa.ImportPkcs8PrivateKey(privateKeyBytes, out _);
   signature = rsa.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
}
string encodedSignature = Convert.ToBase64String(signature)
   .TrimEnd('=').Replace('+', '-').Replace('/', '_');

string jwt = $"{unsignedJwt}.{encodedSignature}";


return true;

Like 1

Like

1 comments
Best reply

Hi Roberto,

In the cloud-based demo version of Creatio (including your current instance), the Script Task in business processes runs under .NET Framework 4.7.2. This limitation is specific to the cloud version. If you run Creatio on-premises, it's possible to configure and run business logic under .NET Core instead.

As a result, the method ImportPkcs8PrivateKey() is not available in the cloud version. Other types like RSASignaturePadding, HashAlgorithmName, and RSA.Create() are also unavailable in this context.

Recommended Solution:
Move JWT generation to an external service
- Create a small Web API (in .NET 6 or above).
- Let it generate and return the signed JWT token.
- Call it from Creatio using HTTP request.

Hi Roberto,

In the cloud-based demo version of Creatio (including your current instance), the Script Task in business processes runs under .NET Framework 4.7.2. This limitation is specific to the cloud version. If you run Creatio on-premises, it's possible to configure and run business logic under .NET Core instead.

As a result, the method ImportPkcs8PrivateKey() is not available in the cloud version. Other types like RSASignaturePadding, HashAlgorithmName, and RSA.Create() are also unavailable in this context.

Recommended Solution:
Move JWT generation to an external service
- Create a small Web API (in .NET 6 or above).
- Let it generate and return the signed JWT token.
- Call it from Creatio using HTTP request.

Show all comments

Hello,

I created a validation for telephone numbers as explained in this article: Implement the validation of a field value on a page | Creatio Academy
For testing purposes, I added it to the notes field on the contacts form, and it works fine.


However, I want to add the validation to the communications options on the left side of the form.
How do I bind the validation in the viewModelConfigDiff?
Also, only communication options of type "phone number" should be validated.

 

Thanks,

Robert

Like 1

Like

3 comments

Hello,

Currently there is no way to add the validator using the regular approach with the validators property on the schema. However you can try adding it using the formControl for the ContactCommunicationOptionsItems (but note that this will be applied for phones, email, skype and web (in other words for all communication options)).

 

How to add the validator using formControl:

 

  1. Implement the same validator on some separate field on the page
  2. Find this validator in the context of the crt.HandleViewModelAttributeChangeRequest request execution (like request.$context._validators["AccountAccountCategory_List.value"][0]), but replace AccountAccountCategory_List.value with your attribute name on the page to which the validator is added. Also make sure array with only one element is returned (since you can have several validators for the same field and the array of validators can contain more than 1 element thus ...["AccountAccountCategory_List.value"][0] can return another validator.
  3. In the context of the crt.HandleViewModelAttributeChangeRequest request (connected to the change of the ContactCommunicationOptionsItems attribute) add the following code:

request.$context.getControl("ContactCommunicationOptionsItems").formControl.addValidators(request.$context._validators["AccountAccountCategory_List.value"][0])
 

But replace equest.$context._validators["AccountAccountCategory_List.value"][0] with the needed validator.

 

This is the only way to add the validator for this CommunicationOptions component (but once again note that this will be added to all the other communication options). 

Oleg Drobina,

thank you for pointing me in the right direction!

However, I can't get it to run...I used the following code, but the validation won't be triggered:

			{
			    request: "crt.HandleViewModelAttributeChangeRequest",
			    handler: async (request, next) => {
					if (request.attributeName === 'ContactCommunicationOptionsItems') {
						const validators = request.$context._validators;
						const telValidator = validators["StringAttribute_cuzyv0b"]?.[0];
						if (telValidator) {
							request.$context.getControl("ContactCommunicationOptionsItems").formControl.addValidators(telValidator);	
						}
					}					
			        return true;
			    }
			}

What's also strange is that when the handler is executed again (after I changed the field value), all properties of the formControl related to validation (asyncValidator, validator, _rawValidators, _rawAsyncValidators) are empty again!

Any idea what could go wrong here?

Thanks,

Robert

 

Robert Pordes,

Unfortunately no, this was the way I used locally and that worked and maybe the difference may arrise in the application version that was used for tests (8.2.2 in my case) or in other handlers maybe. This should be debugged only, there is no other way to identify what's wrong.

Show all comments

Is there a way to implement authentication in an IFrame of my web app inside Creatio using the info of the already signed on user in Creatio?

Like 0

Like

1 comments


Hello, Creatio supports SAML and OpenId authentication protocols. If your third-party application also supports such a protocol, then the task can be realized in theory, the main point is to add an authorization string to the link in Sso: For OpenId: https://sitename.creatio.com/0/Shell/?autoOpenIdLogin=true#IntroPage/SystemDesigner For SAML: https://sitename.creatio.com/Login/NuiLogin.aspx?use_sso=true&ReturnUrl=%2f0%2fShell%2f#IntroPage/SystemDesigner We also recommend that you consider enabling SSO redirect for the environment, so that when you log in to the login page or follow a link, you will be redirected to the Identity Provider's login page: Step 5. in the article: https://academy.creatio.com/docs/user/setup_and_administration/user_and_access_management/authentication/set_up_sso_via_adfs/single_sign-on_via_adfs Unfortunately, we don't have any ready-made instructions, as we haven't tested such solutions, but Creatio supports SSO login, so the rest depends on the implementation. Thank you for contacting us, I hope this helps.

Show all comments

Hello,

In Creatio Studio, is it possible to give a user permissions to add users to any role, except to the sys administrator or supervisor roles? If so, how?

Thanks,

Jose

Like 0

Like

1 comments

Hello,

Unfortunately, it's not possible to implement such a logic due to the specifics of the system.

Show all comments

Hi everyone,

I’m currently facing a technical issue with a webhook handler I’ve implemented in Creatio.

Background:

  • I have a webhook endpoint that gets called by an external system at a rate of approximately 150 hits per second.
  • The Creatio database has a maximum connection limit of 400 connections.

The Problem:

During high load, I observed that the number of open database connections increases rapidly, and some queries are left idle (idle in transaction) even after the handler completes its process.

This leads to:

  • Exhaustion of available database connections
  • Timeout errors on other operations
  • Overall system unresponsiveness

What I’ve Tried So Far:

  1. I modified the data access code by changing queries from ESQ (EntitySchemaQuery) to direct Entity usage.
  2. I manually handled database connections by using:
    • using (DBConnection dbConnection = new DBConnection(...)) { ... }
    • Explicit calls to .Close() and .Dispose() on connections to ensure cleanup.

Despite these adjustments, I'm still seeing idle queries accumulating under high load.

My Questions:

  1. What could be the possible reasons why queries remain idle even after the handler has completed?
  2. Are there any known best practices in Creatio for managing database connections under high request volumes like this?
  3. Is there a proper way to ensure UserConnection or underlying connections are completely released, especially in high-frequency webhook scenarios?

I would really appreciate any insights, suggestions, or shared experiences that could help resolve this issue.

Thank you in advance!

Like 1

Like

0 comments
Show all comments

I need to download a file attached to an object and then upload it to an API that will process it.
I've already tried using Odata, but I always get a 204 error. I also tried creating a web service, but I couldn't. Now I'm trying to convert the file to Base64 using a script task, but I'm still unsuccessful. It's a production environment.

Like 0

Like

2 comments

Hello,

You can find the instructions on working with files via API in the article below:

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

Mira Dmitruk,

Hello Mira, thanks, finally i can do it, i make an internal web service with API File Management, and with some parameters i can get the document in Base64 and send to AI Bot.

Show all comments

i want download an attached file on Creatio, using this endpoint:
https://miinstance.com/0/odata/ContactFile(f7946070-164d-48d3-8516-c31aff3f1588)/Data
But, don't work, If I consult directly without data, I receive the data, but to add /Data i receive the 204 status, y try with demo instance and works!, but in my production enviroment i always get the 204 status

 

{
    "@odata.context": "https://astec.creatio.com/0/odata/$metadata#ContactFile/$entity",
    "Id": "cd7641f2-8e9f-00c5-6662-c68f0f2dd298",
    "CreatedOn": "2025-05-16T22:46:30.610332Z",
    "CreatedById": "410006e1-ca4e-4502-a9ec-e54d922d2c00",
    "ModifiedOn": "2025-05-16T22:46:31.525903Z",
    "ModifiedById": "410006e1-ca4e-4502-a9ec-e54d922d2c00",
    "Name": "Abril 2025.pdf",
    "Notes": "",
    "LockedById": "00000000-0000-0000-0000-000000000000",
    "LockedOn": "0001-01-01T00:00:00Z",
    "TypeId": "529bc2f8-0ee0-df11-971b-001d60e938c6",
    "Version": 1,
    "Size": 135896,
    "ProcessListeners": 0,
    "ContactId": "35e409d2-c8fd-4790-9adf-43ff73abfc3e",
    "SysFileStorageId": "65e42805-0e6d-43c9-8784-32b555f08421",
    "FileGroupId": "efbf3a0d-d780-465a-8e4b-8c0765197cfb",
    "Tag": "",
    "TotalSize": 135896,
    "Data@odata.mediaEditLink": "ContactFile(cd7641f2-8e9f-00c5-6662-c68f0f2dd298)/Data",
    "Data@odata.mediaReadLink": "ContactFile(cd7641f2-8e9f-00c5-6662-c68f0f2dd298)/Data",
    "Data@odata.mediaContentType": "application/octet-stream"
}
Like 0

Like

4 comments

Hello,

Here are a few possible reasons for this behavior and some directions on where to start the investigation:

1. A 204 response usually means the endpoint was found, but the file content is zero bytes. This can happen if the file wasn’t uploaded correctly or if there’s an issue with the file storage. You can confirm this by checking the file size directly in the database, for example:
SELECT DATALENGTH([Data]) AS Bytes
FROM   ContactFile
WHERE  Id = 'f7946070-164d-48d3-8516-c31aff3f1588'
If this returns 0, the problem is likely at the storage level, not the API.

2. In production, the file may be stored in an external location like AWS S3, Azure Blob, or a network share. In this case check the ActiveFileContentStorage system setting is correctly configured.

If your website is using an S3 storage and since it's an external storage there is no possibility to use OData to get files from it. 
In this case we recommend to use a FileApiService in case you need to work with files on your website.

Nick Ovchynnik,

 

Nick Ovchynnik,

Hi Nick, I noticed that the storage is on S3, but I tried to create a web service with FileApiService to retrieve these documents attached to an object, but I wasn't successful. Not to mention creating a ScriptTask didn't work either.
Do you have a working example of how to do this?

Hi,

This article describes the operations with the files. Specifically, under the "Retrieve the file content" expandable tab.

If you face a specific issue with some part of the code, please submit a ticket to support@creatio.com so our team can address the error you got and suggest a solution.

Nick Ovchynnik,

Nick, finally i can make a webservice that, download a base64 of the selected document, let the code here, for help others with the same need.
Thank you very much.

namespace Terrasoft.Configuration.UsrFileRetrievalServiceNamespace {
    using System;
    using System.IO;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using Terrasoft.Web.Common;
    using Terrasoft.Core;
    using Terrasoft.Core.Factories;
    using Terrasoft.File;
    using Terrasoft.File.Abstractions;
 
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class UsrFileRetrievalService : BaseService {
 
        [OperationContract]
        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json,
                   BodyStyle = WebMessageBodyStyle.Wrapped,
                   ResponseFormat = WebMessageFormat.Json)]
        public string GetFileBase64(string fileId, string schemaName) {
            try {
                // Validaciones básicas
                if (string.IsNullOrEmpty(fileId) || string.IsNullOrEmpty(schemaName)) {
                    return "Parámetros inválidos.";
                }
 
                Guid recordId = new Guid(fileId);
 
                // Creamos el localizador del archivo
                var fileLocator = new EntityFileLocator(schemaName, recordId);
 
                // Obtenemos la fábrica de archivos
                IFileFactory fileFactory = UserConnection.GetFileFactory();
 
                // Cargamos el archivo desde la base de datos
                IFile file = fileFactory.Get(fileLocator);
 
                // Leemos el contenido del archivo
                byte[] content;
                using (Stream stream = file.Read()) {
                    using (var ms = new MemoryStream()) {
                        stream.CopyTo(ms);
                        content = ms.ToArray();
                    }
                }
 
                // Convertimos a Base64 para retorno JSON seguro
                return Convert.ToBase64String(content);
            } catch (Exception ex) {
                return $"Error: {ex.Message}";
            }
        }
    }
}
Show all comments

Hi Community,

I'm currently using the RichText element in a Creatio Freedom UI page to load a static HTML page inside a Tab container. The HTML content is stored in a System Setting, and I retrieve this code at runtime to display it using the RichText editor.

For example, I read the HTML code from a System Setting and then attempt to render the full HTML (including inline styles) in the RichText element.

However, I'm facing an issue where inline styles or custom CSS seem to be stripped out.

Figure 1: Original Design Layout

Figure 2: Current UI Output

Has anyone else encountered this?

Any suggestions would be appreciated.

Thanks in advance!

Like 2

Like

0 comments
Show all comments