Question

Receiving messages does not work. Version 7.7.

methods: {
    editRecord: function(editPageUId) {
        this.callParent(arguments);
        var text = "ilaySchema6Detail";
        this.sandbox.publish("PublishDetailName", text);
    }
},
messages: {
    "PublishDetailName": {
        "mode": this.Terrasoft.MessageMode.BROADCAST,
        "direction": this.Terrasoft.MessageDirectionType.PUBLISH
    }
}
methods: {
    subscribeSandboxEvents: function() {
        this.callParent(arguments);
        this.sandbox.subscribe("PublishDetailName", this.getDetailNameFromWhoOpen, this); 
    },
    getDetailNameFromWhoOpen: function(detailName) {
        var a = 5;
    }
},
messages: {
    "PublishDetailName": {
        "mode": this.Terrasoft.MessageMode.BROADCAST,
        "direction": this.Terrasoft.MessageDirectionType.SUBSCRIBE
    }
}

The getDetailNameFromWhoOpen() method cannot be called.

Answer

The issue is that you publish the message before (!) the detail edit page is open. When the page is open, you perform subscription. But the moment is lost. You subscribe to the message when noone will publish it.

You need to execute publish on the edit page, taking the result as a variable.

In the detail schema, execute subscribe, whose handler must be the function returning the value.

Example.

Detail schema:

define("ilaySchema6Detail", [], function() {
    return {
        entitySchemaName: "ilayRecomendation",
        details: /**SCHEMA_DETAILS*/{
        }/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[
        ]/**SCHEMA_DIFF*/,
        methods: {
            addRecord: function(editPageUId) {
                this.callParent(arguments);
            },
            init: function() {
                this.callParent(arguments);
                console.log("id in detail: " + this.sandbox.id);
                this.sandbox.subscribe("PublishDetailName",
                    this.getDetailNameFromWhoOpen, this,
                    [this.sandbox.id]
                );
            },
            getDetailNameFromWhoOpen: function() {
                return {
                    param: "test!"
                };
            }
        },
        messages: {
            "PublishDetailName": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            }
        }
    };
});

Page schema:

define("ilayilayRecomendation1Page", [], function() {
    return {
        entitySchemaName: "ilayRecomendation",
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[
        ]/**SCHEMA_DIFF*/,
        methods: {
            onEntityInitialized: function() {
                this.callParent(arguments);
                var res = this.sandbox.publish("PublishDetailName",
                    null,
                    [this.getDetailId()]
                );
                alert(res.param);
            },
            getDetailId: function() {
                var index = this.sandbox.id.indexOf("ilayilayRecomendation1Page");
                var newId = this.sandbox.id.substring(0, index);
                console.log("id in page: " + newId);
                return newId;
            },
        },
        rules: {},
        messages: {
            "PublishDetailName": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.PUBLISH
            }
        },
        attributes: {
        }
    };
});

 

Like 0

Like

Share

0 comments
Show all comments

Case description:

We want to add tab with attachments and notes into custom section.

This tab looks like this:

Figure 0. "Attachment and notes" tab on contact page.

Algorithm of realization:

  1. Create object which will represent file object in DataBase (ex. ContactFile object in base packages). This object can be exist.
    • You should create new Object and configure it like at next figure:

      Figure 1. Configuration of custom file object.



      IMPORTANT!!! This object must be inherited from File (Base)

       
  2. Add "Notes" field to your section object. It must be multi-line string and have unlimited length 
  3. Add detail to client schema of your page in details section

    Files: {
        schemaName: "FileDetailV2",
        entitySchemaName: "ContactFile", //Name of your object which represent file which connected with you main object
        filter: {
            masterColumn: "Id",
            detailColumn: "Contact"
        }
    },

     

  4. Add code for "define tab", "attachment detail" and "notes field group" in your page. This code you should insert in diff section of your client schema.

     Collapse source

    {
        "operation": "insert",
        "name": "NotesAndFilesTab",
        "parentName": "Tabs",
        "propertyName": "tabs",
        "index": 3,
        "values": {
            "caption": {"bindTo": "Resources.Strings.NotesAndFilesTabCaption"},
            "items": []
        }
    },
    {
        "operation": "insert",
        "parentName": "NotesAndFilesTab",
        "propertyName": "items",
        "name": "Files",
        "values": {
            "itemType": Terrasoft.ViewItemType.DETAIL
        }
    },
    {
        "operation": "insert",
        "name": "NotesControlGroup",
        "parentName": "NotesAndFilesTab",
        "propertyName": "items",
        "values": {
            "itemType": Terrasoft.ViewItemType.CONTROL_GROUP,
            "items": [],
            "caption": {"bindTo": "Resources.Strings.NotesGroupCaption"}
        }
    },
    {
        "operation": "insert",
        "parentName": "NotesControlGroup",
        "propertyName": "items",
        "name": "Notes", //Name of notes field in your main object
        "values": {
            "contentType": Terrasoft.ContentType.RICH_TEXT,
            "layout": {"column": 0, "row": 0, "colSpan": 24},
            "labelConfig": {
                "visible": false
            },
            "controlConfig": {
                "imageLoaded": {
                    "bindTo": "insertImagesToNotes"
                },
                "images": {
                    "bindTo": "NotesImagesCollection"
                }
            }
        }
    }

     

  5. Add localizable strings to resources of your client schema:

    1. NotesAndFilesTabCaption - tab caption 

    2. NotesGroupCaption - notes group caption

  6. IMPORTANT!!! If you have some troubles try to clear browser cache, redis, recompile schemas in bpm'online or restart web-site.  
Like 1

Like

Share

0 comments
Show all comments
  • Add new operation permission “CanManageAccessRight” and add roles who have access.

     
  • Create replacing client module for "Section base schema":

     

BaseSectionV2 schema code

define("BaseSectionV2", [], function() {
    return {
        attributes: {
            "CanManageAccessRight": {
                dataValueType: this.Terrasoft.DataValueType.BOOLEAN
            }
        },
        messages: {
            "UpdateCanManageAccessRight": {
                "mode": Terrasoft.MessageMode.PTP,
                "direction": Terrasoft.MessageDirectionType.SUBSCRIBE
            }
        },
        methods: {
            subscribeSandboxEvents: function() {
                this.callParent(arguments);
                this.sandbox.subscribe("UpdateCanManageAccessRight", function(result) {
                    this.set("CanManageAccessRight", result);
                }, this, [this.getCardModuleSandboxId()]);
            },
            getSchemaAdministratedByRecords: function() {
                return this.callParent(arguments) && this.get("CanManageAccessRight");
            }
        }
    };
});
  • Create replacing client module for "Base card schema":

     

BasePageV2 schema code

define("BasePageV2", ["RightUtilities"], function(RightUtilities) {
    return {
        attributes: {
            "CanManageAccessRight": {
                dataValueType: this.Terrasoft.DataValueType.BOOLEAN
            }
        },
        messages: {
            "UpdateCanManageAccessRight": {
                "mode": Terrasoft.MessageMode.PTP,
                "direction": Terrasoft.MessageDirectionType.BIDIRECTIONAL
            }
        },
        methods: {
            init: function() {
                this.callParent(arguments);
                this.checkCanManageAccessRight();
            },
            checkCanManageAccessRight: function() {
                RightUtilities.checkCanExecuteOperation({operation: "CanManageAccessRight"}, function(result) {
                    this.set("CanManageAccessRight", result);
                    this.sandbox.publish("UpdateCanManageAccessRight", result, [this.sandbox.id]);
                }, this);
            },
            subscribeSandboxEvents: function() {
                this.callParent(arguments);
                this.sandbox.subscribe("UpdateCanManageAccessRight", function() {
                    return this.get("CanManageAccessRight");
                }, this, this.getDetailIds());
            },
            getSchemaAdministratedByRecords: function() {
                return this.callParent(arguments) && this.get("CanManageAccessRight");
            }
        }
    };
});
  • Create replacing client module for "Base schema - Detail with list":

     

BaseGridDetailV2 schema code

define("BaseGridDetailV2", [], function() {
    return {
        attributes: {
            "CanManageAccessRight": {
                dataValueType: this.Terrasoft.DataValueType.BOOLEAN
            }
        },
        messages: {
            "UpdateCanManageAccessRight": {
                "mode": Terrasoft.MessageMode.PTP,
                "direction": Terrasoft.MessageDirectionType.PUBLISH
            }
        },
        methods: {
            init: function() {
                this.callParent(arguments);
                var canManageAccessRight = this.sandbox.publish("UpdateCanManageAccessRight", null, [this.sandbox.id]);
                this.set("CanManageAccessRight", canManageAccessRight);
            },
            getSchemaAdministratedByRecords: function() {
                return this.callParent(arguments) && this.get("CanManageAccessRight");
            }
        }
    };
});

 

Like 5

Like

Share

0 comments
Show all comments

Question

I need to set up displaying of a date of adding a file to the "Files" detail.

Answer

Create a detail replacing schema:

define("FileDetailV2", ["ViewUtilities", "ConfigurationConstants", "ConfigurationEnums", "ImageListViewModel",
        "css!FileDetailCssModule"], function(ViewUtilities, ConfigurationConstants, ConfigurationEnums) {
    return {
        attributes: {
        },
        messages: {
        },
        methods: {
            getGridDataColumns: function() {
                var baseGridDataColumns = this.callParent(arguments);
                var gridDataColumns = {
                    "Type": {
                        path: "Type"
                    },
                    "Version": {
                        path: "Version"
                    }
                };
                return this.Ext.apply(baseGridDataColumns, gridDataColumns);
            }
        },
        diff: /**SCHEMA_DIFF*/[
            {
                "operation": "remove",
                "name": "DataGrid"
            },
            {
                "operation": "insert",
                "name": "DataGrid1",
                "parentName": "Detail",
                "propertyName": "items",
                "values": {
                    "itemType": Terrasoft.ViewItemType.GRID,
                    "listedZebra": true,
                    "collection": {"bindTo": "Collection"},
                    "activeRow": {"bindTo": "ActiveRow"},
                    "primaryColumnName": "Id",
                    "isEmpty": {"bindTo": "IsGridEmpty"},
                    "isLoading": {"bindTo": "IsGridLoading"},
                    "multiSelect": {"bindTo": "MultiSelect"},
                    "selectedRows": {"bindTo": "SelectedRows"},
                    "sortColumn": {"bindTo": "sortColumn"},
                    "sortColumnDirection": {"bindTo": "GridSortDirection"},
                    "sortColumnIndex": {"bindTo": "SortColumnIndex"},
                    "linkClick": {"bindTo": "linkClicked"},
                    "type": "listed",
                    "visible": {
                        "bindTo": "isImageManagerDetailView",
                        "bindConfig": {"converter": "getDataGridVisible"}
                    },
                    "listedConfig": {
                        "name": "DataGridListedConfig",
                        "items": [
                            {
                                "name": "NameListedGridColumn",
                                "bindTo": "Name",
                                "position": {
                                    "column": 1,
                                    "colSpan": 14
                                },
                                "type": Terrasoft.GridCellType.LINK
                            },
                            {
                                "name": "VersionListedGridColumn",
                                "bindTo": "Version",
                                "position": {
                                    "column": 15,
                                    "colSpan": 3
                                }
                            },
                            {
                                "name": "CreatedOnListedGridColumn",
                                "bindTo": "CreatedOn",
                                "position": {
                                    "column": 22,
                                    "colSpan": 2
                                }
                            }
                        ]
                    },
                    "tiledConfig": {
                        "name": "DataGridTiledConfig",
                        "grid": {
                            "columns": 24,
                            "rows": 3
                        },
                        "items": [
                            {
                                "name": "NameTiledGridColumn",
                                "bindTo": "Name",
                                "position": {
                                    "row": 1,
                                    "column": 1,
                                    "colSpan": 24
                                },
                                "type": Terrasoft.GridCellType.LINK
                            },
                            {
                                "name": "ModifiedByTiledGridColumn",
                                "bindTo": "ModifiedBy",
                                "position": {
                                    "row": 1,
                                    "column": 25,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "VersionTiledGridColumn",
                                "bindTo": "Version",
                                "position": {
                                    "row": 1,
                                    "column": 27,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "ModifiedOnTiledGridColumn",
                                "bindTo": "ModifiedOn",
                                "position": {
                                    "row": 1,
                                    "column": 39,
                                    "colSpan": 12
                                }
                            },
                            {
                                "name": "SizeTiledGridColumn",
                                "bindTo": "Size",
                                "position": {
                                    "row": 1,
                                    "column": 51,
                                    "colSpan": 12
                                }
                            }
                        ]
                    },
                    "linkClick": {"bindTo": "linkClicked"}
                }
            }
        ]   /**SCHEMA_DIFF*/
    };
});

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

An error occurs while adding the "Feed" section to the new workplace in the mobile application wizard.

Solution

1. Add the following code in the schema settings of the "Feed" section grid (UsrMobileSocialMessageGridPageSettingsSupervisorworkplace):

{
    "operation": "insert",
    "name": "e0de54d7-b417-42b1-8081-36337aa344a1",
    "values": {
        "row": 0,
        "content": "Created by",
        "columnName": "CreatedBy",
        "dataValueType": 1,
        "operation": "insert"
    },
    "parentName": "settings",
    "propertyName": "items",
    "index": 1
}

2. Change the Message column proprety ("row") to "1" in the settings above. 

"row": 1,

 

Like 0

Like

Share

0 comments
Show all comments

Question

How can i hide the [Edit] button for portal users?

Answer

setIsEditTemplateButtonVisible: function(scope) {
var select = Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "SysAdminUnit"
});
 
select.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN, "Id");
select.addColumn("ConnectionType");
 
var filters = Ext.create("Terrasoft.FilterGroup");
filters.addItem(select.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Id",
    scope.Terrasoft.SysValue.CURRENT_USER.value));
select.filters = filters;
 
select.execute(function(response) {
    if (response.success) {
        if (response.collection.getCount() > 0) {
            var connectionType = response.collection.getByIndex(0).get("ConnectionType");
            if(connectionType === 1){
                scope.set("isEditTemplateButtonVisible", false);
            }else{
                scope.set("isEditTemplateButtonVisible", true);
            }
        }
    }
}, this);

 

Like 0

Like

Share

1 comments

Hi S.Kobizka,

Please confirm where this code we can update?

also please guide, how to add custom button on customer portal dashboard, on click it should open create form of a oob/custom module

 

Regards

Show all comments

Question

How can I pass an account identifier from an order page to the "Product in the order" detail edit page via sandbox messages?

Answer

The code of the order page replacing schema:

define("OrderPageV2", ["OrderPageV2Resources", "GeneralDetails"],
function(resources, GeneralDetails) {
    return {
        entitySchemaName: "Order",
        details: /**SCHEMA_DETAILS*/{
        }/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[
        ]/**SCHEMA_DIFF*/,
        attributes: {},
        methods: {
            onEntityInitialized: function() {
                this.callParent(arguments);
                this.sandbox.subscribe("OrderProductPageAsksForData", function(arg) {
                    console.log("OrderProductPageV2 requests data immediately,");
                    console.log("по Id песочницы: " + arg.sandboxId);
                    // Sending data.
                    this.sendDataToOrderProductPage(arg.sandboxId);
                }, this, [this.sandbox.id]);
                console.log("Мы(OrderPageV2) subscribed to message: OrderProductPageAsksForData.");
                console.log("sandbox Id in this page(OrderPageV2) next:");
                console.log(this.sandbox.id);
            },
            sendDataToOrderProductPage: function(sandboxId) {
                this.sandbox.publish("DataToOrderProductPage", { accountId: this.get("Account").value }, [sandboxId]);
                console.log("AccountId sent as a message to OrderProductPageV2 по Id: " + sandboxId);
            }
        },
        rules: {},
        messages: {
            "DataToOrderProductPage": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.PUBLISH
            },
            "OrderProductPageAsksForData": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            }
        },
        userCode: {}
    };
});

The code of the "Product in order" detail page replacing schema:

define("OrderProductPageV2", ["BusinessRuleModule", "OrderUtilities"],
    function(BusinessRuleModule) {
        return {
            entitySchemaName: "OrderProduct",
            mixins: {},
            attributes: {},
            methods: {
                onEntityInitialized: function() {
                    this.callParent(arguments);
                    this.sandbox.subscribe("DataToOrderProductPage", function(arg) {
                        console.log("OrderPageV2 passes the data over to us!");
                        alert("accountId: " + arg.accountId);
                    }, this, [this.sandbox.id]);
                    console.log("Мы(OrderProductPageV2) subscribed to message: DataToOrderProductPage.");
                    console.log("По нашему(OrderProductPageV2) sandbox Id:");
                    console.log(this.sandbox.id);
                    this.sandbox.publish("OrderProductPageAsksForData", {
                        sandboxId: this.sandbox.id
                    }, [this.getOrderPageSandboxId()]);
                    console.log("Requested data from OrderPageV2, as per its sandbox Id: " + this.getOrderPageSandboxId());
                },
                getOrderPageSandboxId: function() {
                    var index = this.sandbox.id.indexOf("_detail_ProductInProducts");
                    return this.sandbox.id.substring(0, index);
                }
            },
            messages: {
                "DataToOrderProductPage": {
                    mode: Terrasoft.MessageMode.PTP,
                    direction: Terrasoft.MessageDirectionType.SUBSCRIBE
                },
                "OrderProductPageAsksForData": {
                    mode: Terrasoft.MessageMode.PTP,
                    direction: Terrasoft.MessageDirectionType.PUBLISH
                }
            },
            diff: /**SCHEMA_DIFF*/[
            ]/**SCHEMA_DIFF*/,
            rules: {
            }
        };
    }
);

 

Like 0

Like

Share

0 comments
Show all comments

Add code below into methods section and bind openInputBox method.

Example: lookup fields to Contact and Account tables.

Pre-condition: add localizableStrings to your schema (UsrContactCaption, UsrAccountCaption, UsrInputBoxCaption).

openInputBox: function() {
    this.set("UsrContactCollection", new Terrasoft.Collection());
    this.set("UsrAccountCollection", new Terrasoft.Collection());
    this.set("UsrContact", null);
    this.set("UsrAccount", null);
    var controls = {
        "UsrContact": {
            dataValueType: Terrasoft.DataValueType.ENUM,
            isRequired: true,
            caption: resources.localizableStrings.UsrContactCaption,
            value: {
                bindTo: "UsrContact"
            },
            customConfig: {
                tag: "Contact",
                list: {
                    bindTo: "UsrContactCollection"
                },
                prepareList: {
                    bindTo: "getCollectionValues"
                },
                loadNextPage: {
                    bindTo: "loadCollectionNextPage"
                }
            }
        },
        "UsrAccount": {
            dataValueType: Terrasoft.DataValueType.ENUM,
            isRequired: true,
            caption: resources.localizableStrings.UsrAccountCaption,
            value: {
                bindTo: "UsrAccount"
            },
            customConfig: {
                tag: "Account",
                list: {
                    bindTo: "UsrAccountCollection"
                },
                prepareList: {
                    bindTo: "getCollectionValues"
                },
                loadNextPage: {
                    bindTo: "loadCollectionNextPage"
                }
            }
        }
    };
    Terrasoft.utils.inputBox(resources.localizableStrings.UsrInputBoxCaption,
        this.openInputBoxHandler,
        [Terrasoft.MessageBoxButtons.OK, Terrasoft.MessageBoxButtons.CANCEL],
        this,
        controls
    );
    Terrasoft.each(Terrasoft.MessageBox.controlArray, function(item) {
        item.control.bind(this);
    }, this);
},
getCollectionValues: function(filter, list, tag) {
    if (Ext.isEmpty(list)) {
        return;
    }
    list.clear();
    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: tag,
        isPageable: true,
        rowCount: 20
    });
    this.buildCollectionQuery(esq, list, filter, tag);
},
loadCollectionNextPage: function(listParams, tag) {
    if (!this.get("CanLoadMore" + tag)) {
        return;
    }
    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: tag,
        isPageable: true,
        rowCount: 20,
        rowsOffset: listParams.listView.collectionItemsCount
    });
    this.buildCollectionQuery(esq, listParams.list, listParams.filterValue, tag);
},
buildCollectionQuery: function(esq, list, filter, tag) {
    esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN, "value");
    var orderColumn = esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_DISPLAY_COLUMN, "displayValue");
    orderColumn.orderDirection = Terrasoft.OrderDirection.ASC;
    esq.filters.addItem(esq.createPrimaryDisplayColumnFilterWithParameter(
        Terrasoft.ComparisonType.START_WITH, filter, Terrasoft.DataValueType.TEXT));
    esq.getEntityCollection(function(response) {
        if (response && response.success) {
            var preObject = {};
            response.collection.each(function(item) {
                preObject[item.get("value")] = item.values;
            }, this);
            list.loadAll(preObject);
            this.set("CanLoadMore" + tag, response.collection.getCount() === 20);
        }
    }, this);
},
openInputBoxHandler: function(returnCode, controlData) {
    if (Terrasoft.MessageBoxButtons.OK.returnCode === returnCode) {
        // TODO: your code here
    }
}

 

Like 0

Like

Share

2 comments

Hi 

I am using [Country ] and [City] lookup in the input box, But I have to apply the filter on these lookup. 



How is it possible to apply filter on lookups fields in input box ?



Many Thanks.

Dear Akshit,

 

In order to apply filtration over a lookup field in the InputBox please add the following code to the “buildCollectionQuery” method:



            buildCollectionQuery: function(esq, list, filter, tag) {

               esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN, "value");

               var orderColumn = esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_DISPLAY_COLUMN, "displayValue");

               orderColumn.orderDirection = Terrasoft.OrderDirection.ASC;

               esq.filters.addItem(esq.createPrimaryDisplayColumnFilterWithParameter(

                   Terrasoft.ComparisonType.START_WITH, filter, Terrasoft.DataValueType.TEXT));

               esq.filters.addItem(esq.createColumnInFilterWithParameters("Name",

               ["Australia", "United States"]));


               esq.getEntityCollection(function(response) {

                   if (response.success) {

                       var preObject = {};

                       response.collection.each(function(item) {

                           preObject[item.get("value")] = item.values;

                       }, this);

                       list.loadAll(preObject);

                       this.set("CanLoadMore" + tag, response.collection.getCount() === 20);

                   }

               }, this);

            },



Please see the screenshot with the result https://prnt.sc/rtvqvm 



Additionally, please find more information about filtration in esq in the article by the link below:



https://academy.creatio.com/documents/technic-sdk/7-15/entityschemaquery-class-filters-handling

 

Best regards,

Norton

Show all comments

Case description

We want to show Printables (“PRINT” button with printables) for Portal user.

It looks like this:

In a page:

Algorithm of realization.

  1. Give portal user read access permissions to the objects:

1)      Printable (SysModuleReport)

2)      Tables of printable (SysModuleReportTable)

3)      Printable form type (SysModuleReportType)

4)      Section object (SysModuleEntity)

 

How to give read access permissions?

1)      In object you should set ON access by operations and publish object:

 

2) On “Objects permissions” tab in configuration add roles “All portal users” and “All employees” for this object and manage access level for them:

 

        2. In Lookups section find lookup “List of objects available for portal users” and add your objects:

The same operations you should to do for objects from step 1 (SysModuleReport, SysModuleReportTable, SysModuleReportType, SysModuleEntity).

After that clear redis and clear cache in the section and page where should show printables:

Like 0

Like

Share

2 comments

This was working for us till version 7.12.2.1728



Support states: "For now, printables are not yet compatible with the Creatio portal. Yes, they could be added to the portal but we cannot guarantee that they will work as expected."



So hoping it can be resolved soon.

in the latest version too we are unable to view the print option for the portal user though the object permission has been provided for SysModuleReport, SysModuleReportTable, SysModuleReportType, SysModuleEntity. any update from creatio?

 

Show all comments

Question

How can I hide the [Add] buttons for some section types?

Answer

Create the section replacing schema:

define("DocumentSectionV2", ["VisaHelper", "ConfigurationConstants", "BaseFiltersGenerateModule"],
    function(VisaHelper, ConfigurationConstants, BaseFiltersGenerateModule) {
        return {
            entitySchemaName: "Document",
            methods: {
                initEditPages: function() {
                    var enabledEditPages = new this.Terrasoft.Collection();
                    this.callParent(arguments);
                    var editPages = this.get("EditPages");
                    var items = editPages.getItems();
                    for (var i = 0; i < items.length; i++) {
                        if (items[i].values.Id !== "2015b538-40d0-4cbf-9301-fa8cae37ae94") {
                            enabledEditPages.add(items[i]);
                        }
                    }
                    this.set("EnabledEditPages", enabledEditPages);
                }
            },
            diff: /**SCHEMA_DIFF*/[
                {
                    "operation": "merge",
                    "name": "SeparateModeAddRecordButton",
                    "parentName": "SeparateModeActionButtonsLeftContainer",
                    "propertyName": "items",
                    "values": {
                        "controlConfig": {
                            "menu": {
                                "items": {
                                    "bindTo": "EnabledEditPages",
                                    "bindConfig": {
                                        "converter": function(editPages) {
                                            if (editPages.getCount() > 1) {
                                                return editPages;
                                            } else {
                                                return null;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                {
                    "operation": "merge",
                    "name": "CombinedModeAddRecordButton",
                    "parentName": "CombinedModeActionButtonsSectionContainer",
                    "propertyName": "items",
                    "values": {
                        "controlConfig": {
                            "menu": {
                                "items": {
                                    "bindTo": "EnabledEditPages",
                                    "bindConfig": {
                                        "converter": function(editPages) {
                                            if (editPages.getCount() > 1) {
                                                return editPages;
                                            } else {
                                                return null;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            ]/**SCHEMA_DIFF*/
        };
    }
);

 

Like 0

Like

Share

0 comments
Show all comments