Hi all, 



Just wondering whether is there any way that we can run some javascript code / callback function upon completion of business process execution in client module?

 

If so, could you provide the sample code for reference?

 

Thank you very much.

Like 0

Like

2 comments

Hello,

 

If this is needed for versions lower than 8.0.6 (version when the LiveEditing feature was added out-of-the-box that will reload entity automatically in case changes to it were applied by a process) - you can always send a socket message to the client-side logic (like in the example but the message sending mechanism should be in the last script-task of the business process, on the client-side create a method that is triggered upon receiving the message)  or use an already-developed marketplace addon for it.

To elaborate more on what Oleg mentioned. There's no way to have a callback for when the process completes (the callback commented in your code is a callback for the completion of *starting* the process). A process can have things that wait for a period of time, so not really possible to wait for completion.

The approach to take is for the process to notify the client-code that it has completed by sending it a message. This article shows how to send the message: 

https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…

If needed, this article shows how to receive the message in a Freedom UI page: 

https://customerfx.com/article/receiving-server-side-messages-in-a-crea…

However, if the page is Freedom UI, a better approach is to enable live data updates for the object so the refresh happens automatically when the data changes in the process. More about that here: 

https://customerfx.com/article/automatically-refreshing-a-creatio-freed…

From the code you posted, it looks like this is a classic page, so you'd have to go the first route for sending a message from the process to the client page.

Ryan

Show all comments

Hello,

 

I have read through on locking fields using client module in Creatio. I have found that we can simply setting the "isModelItemEnabled" to true/false. And for more complex situation, we can create a function named "isModelItemEnabled" and write our code logic and return boolean value conditionally.

 

At the same time, I noticed that "isModelItemEnabled" is triggered before "onEntityInitialized" is triggered. This results to some of the values required to be used in "isModelItemEnabled" undefined.

 

Is there anyway to workaround this?

Like 0

Like

2 comments
Best reply

Rather than create a function, use an attribute. Then in the onEntityInitialized you can read any values and then set the attribute to true/false. See an example here: https://customerfx.com/article/completely-locking-a-page-via-code-inclu…

Also, just to point out, you mention locking a single field. If all you need is to lock a single field, there's no need to use IsModelItemsEnabled. Instead you can bind the visible for the field to an attribute and set as true/false as needed. See https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Ryan

Rather than create a function, use an attribute. Then in the onEntityInitialized you can read any values and then set the attribute to true/false. See an example here: https://customerfx.com/article/completely-locking-a-page-via-code-inclu…

Also, just to point out, you mention locking a single field. If all you need is to lock a single field, there's no need to use IsModelItemsEnabled. Instead you can bind the visible for the field to an attribute and set as true/false as needed. See https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Ryan

Okay, I will try it out. Thank you very much Ryan, best as always😄

Show all comments

I have added a button on every record in detail for a particular column. I am trying to have one more button on the same detail, But the button is not visible on the UI.

The code that i used for this is:

{
"operation": "merge",
"name": "DataGrid",
"parentName": "DataGridContainer",
"propertyName": "items",
"values": {
"className": "Terrasoft.ControlGrid",
"controlColumnName": "UsrPlanningManagerRelevance",
"applyControlConfig": {"bindTo": "applyControlConfig"}
}
},

METHOD

applyControlConfig: function(control, activeRow) {
control.config = {
"className": "Terrasoft.Button",
"style": Terrasoft.controls.ButtonEnums.style.BLUE,
"caption": "מסמכי רקע",//this.get("Resources.Strings.FileButtonCaption"),
"imageConfig": {"bindTo": "Resources.Images.ExportToExcelBtnImage"},
"handler": this.BackgroundDocumentsClick.bind(this, activeRow.id)
};

Can anyone help me on this?

Like 1

Like

1 comments
Best reply

Hi,



I think, you can do this by appending buttons in the targeted column.

 

var baseEle = "#Identifier div[id*=\"item-" + rowId + "\"]  div:nth-last-child(2)";
$(baseEle).append(Ext.String.format("<span></span>"));
 
var ele = baseSelector + ">span";
$(ele).click(function() {});

 

Loop collection in prepareResponseCollection method or onGridDataLoaded

Hi,



I think, you can do this by appending buttons in the targeted column.

 

var baseEle = "#Identifier div[id*=\"item-" + rowId + "\"]  div:nth-last-child(2)";
$(baseEle).append(Ext.String.format("<span></span>"));
 
var ele = baseSelector + ">span";
$(ele).click(function() {});

 

Loop collection in prepareResponseCollection method or onGridDataLoaded

Show all comments

Hi 

I want to add SelectPdf library to Creatio and use it in BP 

however when  I upload using the import in the Configuration section into package

it ask for the Select.Html.dep in the dotnet shared folder 

I added manually but I get error that kernel32.dll is missing, as I know this kernal is window specific dll and not for linux

Is am doing this right or something missing?

Like 0

Like

2 comments

Hello,

 

Can you please point me on where to download the exact dll from here https://selectpdf.com/pdf-library-for-net/ to test its upload to the app?

 

Thank you!

SelectPdf requires a Windows server, it does not work on Linux according to it's docs. From here: https://selectpdf.com/docs/Installation.htm

Currently it requires a Windows system to run. It does not work on Linux or Mac or Xamarin.

Ryan

Show all comments

Hello,

 

Can I get Marketing Creatio training videos in Russian? 

 

Thanks in advance. 

Like 0

Like

1 comments

Hi!

 

We currently do not have Russian video materials ready. Thank you for bringing up the idea!

 

We will take it into consideration.

Show all comments

Hi all,

 

I'm trying to migrate a package from our dev site to production.



We have multiple metric widgets on one of the pages and these are not migrating with the package (only their placeholders in the diff).



Can anybody advise what needs to be bound to the package to ensure these elements migrate across?



Nb. Version is up-to-date but we are not using the Freedom UI.

Like 0

Like

1 comments
Best reply

The metric definition is stored in SysWidgetDashboard. 

 

You’ll need to locate the row and bind the data to your package. The page code will contain the Id for  the record. 

The metric definition is stored in SysWidgetDashboard. 

 

You’ll need to locate the row and bind the data to your package. The page code will contain the Id for  the record. 

Show all comments

after adding ssl the websocket in pending status

 

Like 0

Like

1 comments

Greetings,



We kindly ask you to contact us via email at support@creatio.com for an in-depth analysis of your error.

Show all comments

I am trying to create a new section in a different workplace with an existing object. The Package is from my "Invoices" object, which has all the material I need; however, anytime I try to access this via the New: Section wizard, "SELECT EXISTING OBJECT", I get the error, "Section for this object already exists."



I am having an increasingly hard time maneuvering through the customization of Creatio no-code, without being directed to use schemas, SQL, or outdated object-relational mapping.

Like 1

Like

1 comments

Hello,

 

Indeed, in Creatio, creating multiple sections for one object is impossible. You either need to remove existing sections or create a new object for the new section.

Show all comments

Hi Community,

 

We are using the case section with 4 different pages based on the case types. We are required to disable the creation permission for different page types based on the user roles.

The OOTB Operation permission functionality in the object permission allows the Restriction at the object level. However, according to the requirement, we require this permission at the page level. Is there any workaround for us to achieve this?

 

I also tried the code attached below to achieve this requirement. But seems like I am missing something and the code is not working as expected.

 

initEditPages: function () {
    var roleName = "System administrators";
 
    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: "SysUserInRole"
    });
    esq.addColumn("SysRole");
 
    esq.filters.add("UserFilter", Terrasoft.createColumnFilterWithParameter(
        Terrasoft.ComparisonType.EQUAL, "SysUser", Terrasoft.SysValue.CURRENT_USER.value
    ));
 
    esq.filters.add("RoleFilter", Terrasoft.createColumnFilterWithParameter(
        Terrasoft.ComparisonType.EQUAL, "SysRole.Name", roleName
    ));
 
    esq.getEntityCollection(function(result) {
        if (!result.success || result.collection.getItems().length === 0) {
            // the user is *not* in the role 
            // do something here if needed
        }
        else {
            // the user *is* in the role
            var scope = this;
            var Ext = this.Ext;
            var Terrasoft = this.Terrasoft;
            var collection = Ext.create("Terrasoft.BaseViewModelCollection");
            var entityStructure = this.getEntityStructure(this.entitySchemaName);
            if (entityStructure) {
                Terrasoft.each(entityStructure.pages, function(editPage) {
                    var typeUId = editPage.UId || Terrasoft.GUID_EMPTY;
                    if (editPage.cardSchema === "BEACRCase2Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    }
                    else if (editPage.cardSchema === "BEACRCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    } else if (editPage.cardSchema === "BEACCCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    } else if (editPage.cardSchema === "BEAKRCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    }
                }, scope);
            }
            this.set("EditPages", collection);
        }
    }, this);
},

 

Kindly assist me in resolving this issue, please.

Like 0

Like

4 comments

Hello,

 

1) If you need to check roles and grant them access to some functionality it's much better to do via operations permissions check.

2) Because of point 1 you need to create several operation permissions and check all of them using RightUtilities.checkCanExecuteOperation method.

3) Based on the check result from point 2 - remove edit pages from the collection of edit pages. To do that:

 

3.1) Override SeparateModeAddRecordButton in the section schema

3.2) Add the check like the following:

{
				"operation": "merge",
				"name": "SeparateModeAddRecordButton",
				"parentName": "SeparateModeActionButtonsLeftContainer",
				"propertyName": "items",
				"values": {
					"controlConfig": {
						"menu": {
							"items": {
								"bindTo": "EditPages",
								"bindConfig": {
									"converter": function(editPages) {
										if (editPages.getCount() > 1) {
											RightUtilities.checkCanExecuteOperation({operation: "CanCreateCustomerContact"}, function(result) {
												if (result) {
													editPages.collection.items = editPages.collection.items.filter(item => item.values.Caption.includes("Customer"));
													return editPages;
												}
 
											});
										} else {
											return null;
										}
									}
								}
							}
						}
					}
				}
			}

It will also check if the role of the current user is in the operation permission and you don't need to call ESQ to get the list of roles, you can control it directly via the "Operation permissions" section.

 

In the example above all edit pages but "Customer" will be removed from the list if the user has access to the "CanCreateCustomerContact" operation (for all other users the "New" button in the Contacts section won't do anything).

 

So you need to test this approach and apply it to your business task.

Hi Oleg,

 

I appreciate your support. Please see the steps below, that were executed. I seem to be missing something and cannot see the expected result.

 

1. Step 01:

Created a new operation permission with the code - "CanCreatePendingDocumentCase" and added the relevant user roles who can create the particular type of case (Pending Document)

 

2. Step 02:

Added the below code snippet in the replacing section schema in the diff array

{
                "operation": "merge",
                "name": "SeparateModeAddRecordButton",
                "parentName": "SeparateModeActionButtonsLeftContainer",
                "propertyName": "items",
                "values": {
                    "controlConfig": {
                        "menu": {
                            "items": {
                                "bindTo": "EditPages",
                                "bindConfig": {
                                    "converter": function(editPages) {
                                        if (editPages.getCount() > 1) {
                                            RightUtilities.checkCanExecuteOperation({operation: "CanCreatePendingDocumentCase"}, function(result) {
                                                if (result) {
                                                    editPages.collection.items = editPages.collection.items.filter(item => item.values.Caption.includes("Pending Document"));
                                                    return editPages;
                                                }
                                            });
                                        } else {
                                            return null;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

 

Step 03:

Cleared the cache and checked whether only pending document case is available in the new button drop-down of the section.

 

But the dropdown is showing all the case types in the new button regardless of the user role.

Geeviniy Vazavan,



1) Is the Edit page called "Pending Document" (with this uppercase in P and D)? Includes method is case sensitive in JS.

 

2) which result is passed to the result of checkCanExecuteOperation method execution?

 

3) Have you added the button to the correct schema (for example it should be in ContactSectionV2, not in the ContactPageV2)?

 

4) Is the converted code triggered in the debugger?

Hi Oleg,

 

Please see the answers below.

 

1. Yes. The edit page "Pending Document" is in upper case P and D.

2. Result is "true"

3. It is added to the "CaseSection" schema

4. Yes. It is triggered.

Show all comments
Question
Like 0

Like

1 comments

Hello,

 

In this article it's shown that during the render method execution we've created a component in DOM

const component = document.createElement("angular-element-component");

In initDomEvents method the "this" context represents the DOM itself and using "this.component" you retrieve the component and add a click action to this component.

Show all comments