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

Good day!

 

The report is generated in Word format.

Website version 7.18.5

Screenshot attached

 

In one of our tables, we have several products linked to a specific Id. Each product is associated with its unique point of inclusion address. The product names are successfully pulled and correctly displayed in the report table - each name in a separate line, which fully meets our requirements. We set this up through the table part report settings.

 

The problem arises with the addresses of the points of inclusion, the values for which we obtain using a macro. In the current configuration, all addresses for the three products are collected and displayed in one line of the table, instead of being located in the corresponding lines opposite each product.

 

Question:

Could you advise on how we might modify the macro or the process of its operation so that the addresses of the points of inclusion are placed in separate cells of the table in accordance with each product?

File attachments
Like 0

Like

1 comments

Hello,

 

Could you please provide us with an example of the macro you are using?

Please provide the table settings, and also take a screenshot of how this table looks specifically in the printable template in word plugin.

Show all comments