Hi Community,

I'm trying to identify the ObjectName (schema name) and the RecordId of a form page that is currently open in Creatio (Freedom UI), using the context data available (as shown in the attachment). Is there a recommended way to retrieve this information through code or the browser console?

What’s the best way to access this data from within the button click handler?

Reference Screenshot

Thanks in advance!

Ajay K

Like 1

Like

1 comments

This is possible, but only from the context of the page itself. I am not sure if it's possible from a sidebar to know anything about the current page loaded elsewhere, maybe with a request handler in a remote module where you can specify the scopes?

As for getting this info within the context of the page, to get the primary data source, you can use: 

const pds = await request.$context.getPrimaryModelName();

With the data source name, you can get the schema for the datasource which will give you the entity/object name, the Id column attribute, and also the primary display value attribute using the following (note, this gets the attribute names, not the values): 

const pds = await request.$context.getPrimaryModelName();
const schema = await request.$context.dataSchemas[pds];
 
const entityName = await schema.name;
const idColumn = await schema.primaryAttributeName;
const nameColumn = await schema.primaryDisplayAttributeName;

Now that you have the attribute names, you can get the values: 

const idValue = await request.$context[idColumn];
const nameValue = await request.$context[nameColumn];
// etc

This sort of thing works great if you have a custom base page type that could be used for many different pages/objects. 

Also, as a FYI, not sure how this is going to change after 8.2.3 since 8.2.3 has a beta feature (not enabled out of the box) that allows a page to have multiple connected data sources. That might break some of this.

Ryan

Show all comments

Hey Team , i have a user task in the lead section and inorder to move from one stage to another ( custom stages) , i have put up a user based task. However when the user clicks on complete , the system throws the below error 

I have not written this view.On multiple compilations , i still seem to face this issue.
Please note that this issue is occuring in my local , and when the same code is pulled by others to their local , this seems to work.

Like 0

Like

1 comments

Hello!

Could you please provide some details about the transfer of stages, especially the part related to user tasks?

Show all comments

Hello mates !

I'm trying to create a script into a business process to check the SIRET (French Enterprise Number). But I'm having a basic problem: an identifier is expected when I try to compile on line 59

using System.Text.RegularExpressions;
 
string siretNumber = Get<String>("siret");
bool siretValide = Get<bool>("siretValide");
 
int ttlAddition = 0, cpt = 1;
 
string formatInput = Regex.Replace(siretNumber, "[^a-zA-Z0-9_]+", "", RegexOptions.Compiled);
string reverseCard = new string(formatInput.ToCharArray().Reverse().ToArray());
 
int[] arrDigits = Array.ConvertAll<string, int>(
    System.Text.RegularExpressions.Regex.Split(reverseCard.ToString(), @"(?!^)(?!$)"),
    str => int.Parse(str)
);
int[] arrMult = new int[arrDigits.Length];
 
// First Luhn step:
// Start with the last digit (on the right)
// and move to the left, doubling the value of all even-numbered digits
for (int i = 0; i < arrDigits.Length; i++)
{
    if (cpt == 1)
        arrMult[i] = arrDigits[i]; // the key is processed first, the number is not doubled 
    else
    {
        if (cpt % 2 == 0)
            arrMult[i] = 2 * arrDigits[i];
        else
            arrMult[i] = arrDigits[i];
    }
    cpt++;
}
 
// Add together all the digits of each number thus obtained.
// If digit > 10, then the digit to be added gives, for example: 18 = 1 + 8
for (int i = 0; i < arrMult.Length; i++)
{
    if ((int)arrMult[i] >= 10) // if number > 9 you have to break down the number, e.g. 18 gives: 1+8
    {
        int[] intList = Array.ConvertAll<string, int>(
            System.Text.RegularExpressions.Regex.Split(arrMult[i].ToString(), @"(?!^)(?!$)"),
            str => int.Parse(str)
        );
        for (int j = 0; j < intList.Count(); j++)
        {
            ttlAddition += (int)intList[j];
        }
    }
    else
        ttlAddition += (int)arrMult[i];
}
 
// if modulo by 10 of the addition is zero then our figure is valid 
if (ttlAddition % 10 == 0)
    Set<bool>("siretValide", true); // set the variable siretValide to true in Creatio 
else
    Set<bool>("siretValide", false);

Compilation error

In VS Code, by replacing the last lines: Set<bool>("siret Valide", true); with Console.WriteLine("Verification OK"); and Set<bool>("siret Valide", false); with Console.WriteLine("Verification KO"); the program works fine.

 

Like 0

Like

4 comments
Best reply

Hello,

 

You can add using statement in Usings section in Methods block Of BP like this:

Also here is the fixed example of your code without compilation errors:

 

string siretNumber = Get&lt;String&gt;("siret");
bool siretValide = Get&lt;bool&gt;("siretValide");
 
int ttlAddition = 0, cpt = 1;
 
string formatInput = Regex.Replace(siretNumber, "[^a-zA-Z0-9_]+", "", RegexOptions.Compiled);
var formatInputCharArray = formatInput.ToCharArray();
Array.Reverse(formatInputCharArray);
string reverseCard = new string(formatInputCharArray);
 
int[] arrDigits = Array.ConvertAll&lt;string, int&gt;(
   System.Text.RegularExpressions.Regex.Split(reverseCard.ToString(), @"(?!^)(?!$)"),
   str =&gt; int.Parse(str)
);
int[] arrMult = new int[arrDigits.Length];
 
// First Luhn step:
// Start with the last digit (on the right)
// and move to the left, doubling the value of all even-numbered digits
for (int i = 0; i &lt; arrDigits.Length; i++)
{
	if (cpt == 1)
		arrMult[i] = arrDigits[i]; // the key is processed first, the number is not doubled 
	else
	{
		if (cpt % 2 == 0)
			arrMult[i] = 2 * arrDigits[i];
		else
			arrMult[i] = arrDigits[i];
	}
	cpt++;
}
 
// Add together all the digits of each number thus obtained.
// If digit &gt; 10, then the digit to be added gives, for example: 18 = 1 + 8
for (int i = 0; i &lt; arrMult.Length; i++)
{
	if ((int)arrMult[i] &gt;= 10) // if number &gt; 9 you have to break down the number, e.g. 18 gives: 1+8
	{
		int[] intList = Array.ConvertAll&lt;string, int&gt;(
           System.Text.RegularExpressions.Regex.Split(arrMult[i].ToString(), @"(?!^)(?!$)"),
           str =&gt; int.Parse(str)
       );
		for (int j = 0; j &lt; intList.Length; j++)
		{
			ttlAddition += (int)intList[j];
		}
	}
	else
		ttlAddition += (int)arrMult[i];
}
 
// if modulo by 10 of the addition is zero then our figure is valid 
if (ttlAddition % 10 == 0)
	Set&lt;bool&gt;("siretValide", true); // set the variable siretValide to true in Creatio 
else
	Set&lt;bool&gt;("siretValide", false);
return true;

Also please make sure that "siret" and "siretValide" parameters have the values assigned before this Script Task is executed. 

 

Hello

In a task script, you're not allowed to add the using statements.
Also, the script must end with:
return true;

You can add the using statements at the Methods block in the BP.

Hope this helps!

Mohamed Ouederni,

Hello Mohamed,
Thank you for your help ! i m a newbie in C#.

So i followed your recommandations:

i removed the using System.Text.RegularExpressions; at the script beginning, because when i open the process source code there is allready a using System.Text

i added a return true at the end of the script.

and i added too System.Text.RegularExpressions on the formatInput string :

string formatInput = System.Text.RegularExpressions.Regex.Replace(siretNumber, "[^a-zA-Z0-9_]+", "", System.Text.RegularExpressions.RegexOptions.Compiled);

But now i have the following errors:
compilation error

Line 65 is :
string reverseCard = new string(formatInput.ToCharArray().Reverse().ToArray());
 

Hello,

 

You can add using statement in Usings section in Methods block Of BP like this:

Also here is the fixed example of your code without compilation errors:

 

string siretNumber = Get&lt;String&gt;("siret");
bool siretValide = Get&lt;bool&gt;("siretValide");
 
int ttlAddition = 0, cpt = 1;
 
string formatInput = Regex.Replace(siretNumber, "[^a-zA-Z0-9_]+", "", RegexOptions.Compiled);
var formatInputCharArray = formatInput.ToCharArray();
Array.Reverse(formatInputCharArray);
string reverseCard = new string(formatInputCharArray);
 
int[] arrDigits = Array.ConvertAll&lt;string, int&gt;(
   System.Text.RegularExpressions.Regex.Split(reverseCard.ToString(), @"(?!^)(?!$)"),
   str =&gt; int.Parse(str)
);
int[] arrMult = new int[arrDigits.Length];
 
// First Luhn step:
// Start with the last digit (on the right)
// and move to the left, doubling the value of all even-numbered digits
for (int i = 0; i &lt; arrDigits.Length; i++)
{
	if (cpt == 1)
		arrMult[i] = arrDigits[i]; // the key is processed first, the number is not doubled 
	else
	{
		if (cpt % 2 == 0)
			arrMult[i] = 2 * arrDigits[i];
		else
			arrMult[i] = arrDigits[i];
	}
	cpt++;
}
 
// Add together all the digits of each number thus obtained.
// If digit &gt; 10, then the digit to be added gives, for example: 18 = 1 + 8
for (int i = 0; i &lt; arrMult.Length; i++)
{
	if ((int)arrMult[i] &gt;= 10) // if number &gt; 9 you have to break down the number, e.g. 18 gives: 1+8
	{
		int[] intList = Array.ConvertAll&lt;string, int&gt;(
           System.Text.RegularExpressions.Regex.Split(arrMult[i].ToString(), @"(?!^)(?!$)"),
           str =&gt; int.Parse(str)
       );
		for (int j = 0; j &lt; intList.Length; j++)
		{
			ttlAddition += (int)intList[j];
		}
	}
	else
		ttlAddition += (int)arrMult[i];
}
 
// if modulo by 10 of the addition is zero then our figure is valid 
if (ttlAddition % 10 == 0)
	Set&lt;bool&gt;("siretValide", true); // set the variable siretValide to true in Creatio 
else
	Set&lt;bool&gt;("siretValide", false);
return true;

Also please make sure that "siret" and "siretValide" parameters have the values assigned before this Script Task is executed. 

 

Hello Iryna !
This fixed the two first errors.

compilation error

it looks like system can not find Count, so i added System.link to the method block of the BP and the process has been successfully compiled.

Thank you all for you help !

Show all comments

Hello Community,

I need to store a snippet of HTML code (e.g., a button or formatted content) into a field of an object (e.g., a text or string field). Later, I want to render this HTML dynamically on a page at runtime.

What’s the best way to store the HTML safely and then render it so that it's interpreted as actual HTML (not plain text) in the UI?
Are there any security or encoding considerations I should keep in mind?

Thanks in advance!

Like 2

Like

7 comments
Best reply

An easy no code way would be to bind the value to a read-only Rich Text control on the page. It will display the HTML as HTML.

Otherwise, you'd have to create your own custom control for it.

An easy no code way would be to bind the value to a read-only Rich Text control on the page. It will display the HTML as HTML.

Otherwise, you'd have to create your own custom control for it.

Ryan Farley,

Thanks for the suggestion! I am looking for custom control.

Is there any reference or example available to create custom control.

Hello Ajay,

Here is the article that contains the explanation and example of how to create custom control

https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/8.1/front-end-development/classic-ui/controls/examples/add-a-control-to-a-record-page

Also inside your custom control implementation you can add HTML value validation and remove any script elements to provide the level of security. 

Hi Iryna,

 

Is above link, you provided, applied for Freedom UI module?

The information and example for Freedom UI you can find here:

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

This simple example of an IFRAME control could easily be adapted to simple output a div containing the custom HTML instead, plus you'd just bind the column containing the HTML to the control. https://customerfx.com/article/embedding-an-iframe-on-a-creatio-freedom-ui-page/

A full component would likely be a better route, but this simpler option coudl still get the job done.

Ryan

Hi Ryan Farley,

When I bind a value to a read-only Rich Text control on the page, only the raw HTML is displayed and the CSS styles are stripped out.

Show all comments

Hi

Does anyone know what value goes in the screenshot below for Unique Caption ID, when adding a notification record for a feed (record)? I have tried the Feed Channel ID  but the link does not take the user to the record (nor does the ID of message). Many thanks

Like 0

Like

2 comments

Rob,

WHat you need is to add a feed message connected in an specific section?

Julio.Falcon_Nodos,

Hi Julio,

So I have created the feed message in the Feed Section but I want to notify all users when a new one is posted. I am unable to select Feed Channel in the Object so I selected Message/comment which at least allows for the notification to be sent and received by the users. I then want the users to be able to click on notification so it takes them to the Feed Channel but using the channel ID does not work, so i am not sure what needs to go in here. I don' think there is an automatic way to tag all users in on a new feed, which is why i have tried a notification

 

thanks

Show all comments

Hi Community,

I'm working with Creatio Freedom UI and I need to embed a custom HTML layout along with some JavaScript logic (e.g., loading an external widget) into a page.

I’m looking for a proper way to add both:

  • Custom HTML code,

    .......

    </head>
    <body>
        <div style="width: 100%;">
            <div id="xyz1"></div>
            <div id="xyz2">
                <div style="width: 100%;">
                    <div id="queryBox" style="width: 100%;"></div>
                </div>
            <div  id="xyz3"></div>
            </div>
        </div>
    </body>
    </html>

  • External or inline JavaScript code (e.g., via <script> tags)

I've tried using custom components and inserting HTML using JavaScript (e.g., innerHTML), but I'm unsure if this is the recommended approach or if there's a native method provided by Creatio.

Could someone please guide me on:

  • The best practice for injecting HTML/JS into Freedom UI pages
  • Whether I can safely reference external JS/CSS (like from a CDN)
  • Any Creatio-supported way to dynamically render and control such elements

Thanks in advance! 
Any documentation links or working examples would be really helpful.

Regards,

Ajay Kuthe

Like 3

Like

1 comments
Best reply

Creatio does allow you to create your own custom UI components that you can add to the UI and even handle requests, read data, bind properties, etc. Documentation here on creating custom components: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/category/freedom-ui-component

Video tutorial here: https://www.youtube.com/watch?v=CE5uETqTsyQ&list=PLnolcTT5TeE2BMFf_XmJrSwpnbcLCLJkb

A simple approach (with limited capabilities compared to creating a full control) can be seen here: https://customerfx.com/article/embedding-an-iframe-on-a-creatio-freedom-ui-page/ (you could use this approach to render any HTML, not just an IFRAME as the article shows)

Ryan

Creatio does allow you to create your own custom UI components that you can add to the UI and even handle requests, read data, bind properties, etc. Documentation here on creating custom components: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/category/freedom-ui-component

Video tutorial here: https://www.youtube.com/watch?v=CE5uETqTsyQ&list=PLnolcTT5TeE2BMFf_XmJrSwpnbcLCLJkb

A simple approach (with limited capabilities compared to creating a full control) can be seen here: https://customerfx.com/article/embedding-an-iframe-on-a-creatio-freedom-ui-page/ (you could use this approach to render any HTML, not just an IFRAME as the article shows)

Ryan

Show all comments

I have a business process which automatically creates a new feed record within a specific channel and I want to notify ALL users every time this is done. From what I can see the add notification only allows to send to one contact?

 

 

 


 

Like 0

Like

2 comments
Best reply

could not find a way to do this so just created a business process that basically just looped round and sent one at a time to each contact. Not ideal if you have lots of users but worked ok with the number I had

could not find a way to do this so just created a business process that basically just looped round and sent one at a time to each contact. Not ideal if you have lots of users but worked ok with the number I had

Hello,

Unfortunately, this type of process cannot be implemented using out-of-the-box tools. It requires additional development effort. To achieve the desired functionality, you would need to use a Script Task element within the business process and implement custom code that sends notifications to all users.

Please note that the development team already has a task to enhance and expand this functionality in future releases. However, as this feature is still in the development and testing phase, we are currently unable to provide an estimated timeline for its availability.

Best regards,
Antonii.

Show all comments

Dear,
I made a forecast on the products ordered by customers in order to obtain the total quantities per product ordered over several years and by year.
Now I would like to display this data on the account page as a table filtered by account.
Is it possible to access the forecast tables and display filtered data (by account) ?

Thank you,
Nicolas

Like 0

Like

1 comments

Dear Nicolas,

You can implement this logic in Freedom UI pages using "Apply filter by page data". 


Below, you can see an example of this binding using "Case Lifecycle" list as an example:

image.png

Here is a link on how to set this up: https://academy.creatio.com/docs/8.x/no-code-customization/customization-tools/ui-and-business-logic-customization/element-setup-examples/components/set-up-list-components#title-2761-2 

I hope this helps. Have a great day!

Show all comments

Hello,

Could I get some help understanding or directing me to an article that thoroughly explains the lookup titled "Package in installed application?"

What does the "Primary" check box do? What does the "Current package" check box do?

Can a package be named in more than one row, aka, more than one application?

I cannot locate an academy article explaining this function.

Like 0

Like

1 comments

Dear,

On freedom, we can't delete feeds that aren't ours, even if we're an administrator.
Can we change this behaviour?
Administrators should be able to delete feeds even if they're not their own.
Is this possible?

Thank you!

Nicolas

Like 0

Like

1 comments

Hello!

 

Unfortunately, by default, this functionality cannot be implemented due to the core logic of the application’s configuration.

 

When working with the Feed tab, you are interacting with a system object governed by predefined rules. According to these rules, only the user who created the post (the Owner) has the ability to delete (Remove) or edit (Edit) it, just like with other system objects. 

 

However, we have forwarded your suggestion to our development team for review, and they will explore the possibility of implementing such a feature in future releases.

 

Thank you for helping us improve Creatio!

Show all comments