Hi,

I'm working on a Button component in Case Module that contains submenu 

Button's Source Code:

 

Submenu's Source Code:

 

In the source code, Currently fetching these submenus individually using Localizable String as the following:

let ActionBtnSubmenu= [
                               await request.$context.Resources.Strings.MenuItem_ll5to4b_caption,
                               await request.$context.Resources.Strings.MenuItem_ilbm7ox_caption,
                               await request.$context.Resources.Strings.MenuItem_aou2m8v_caption,
                            ];

Is there a way to retrieve these submenu items as an array— defined collectively in the DemoActionButton detail or elsewhere—so that I don’t have to fetch them one by one?

 

Platform: Creatio:Energy (Freedom UI)

Like 0

Like

1 comments
Best reply

Hello Souresh,

 

Unfortunately there is no such property in request.$context that contains all submenu items that belong to some specific button.

If you want to get the submenu items as an array without fetching them one by one you can use the following approach

const menuItems = Object.entries(request.$context.resources.strings)
	.filter(([key, _]) => key.includes("MenuItem_"))
	.map(([_, value]) => value);

or if you have other buttons with submenu items on your page you should use other filtering condition to get only the menu items that belong to the correct button.

const menuItems = Object.entries(request.$context.resources.strings)
	.filter(([key, _]) => key.includes("_ll5to4b") || key.includes("_ilbm7ox") || key.includes("_aou2m8v"))
	.map(([_, value]) => value);


As other option you can create a separate module to store the array with menu items data and then use that array. But in this case you will have to be attentive and not forget to modify this module in case of changes in the designer.

 

Hello Souresh,

 

Unfortunately there is no such property in request.$context that contains all submenu items that belong to some specific button.

If you want to get the submenu items as an array without fetching them one by one you can use the following approach

const menuItems = Object.entries(request.$context.resources.strings)
	.filter(([key, _]) => key.includes("MenuItem_"))
	.map(([_, value]) => value);

or if you have other buttons with submenu items on your page you should use other filtering condition to get only the menu items that belong to the correct button.

const menuItems = Object.entries(request.$context.resources.strings)
	.filter(([key, _]) => key.includes("_ll5to4b") || key.includes("_ilbm7ox") || key.includes("_aou2m8v"))
	.map(([_, value]) => value);


As other option you can create a separate module to store the array with menu items data and then use that array. But in this case you will have to be attentive and not forget to modify this module in case of changes in the designer.

 

Show all comments

Hello Community,

 

I want to hide the elements "Home", "Run process" and "New" on the top menu:

 

 

This elements should be hidden for all roles. Can you please help me?

 

Thank you very much!

Like 1

Like

1 comments

Hello Javier,

 

To achieve this:

 

1) Create a module with no parent module in configurations called UsrLeftPanelTopMenuModule

2) Add the following content to the module:

define("UsrLeftPanelTopMenuModule", ["LeftPanelTopMenuModuleResources", "LeftPanelTopMenuModule"],
    function(resources) {
        Ext.define("Terrasoft.configuration.UsrLeftPanelTopMenuModuleViewModel", {
            alternateClassName: "Terrasoft.UsrLeftPanelTopMenuModuleViewModel",
            override: "Terrasoft.LeftPanelTopMenuModuleViewModel",
            getTopMenuConfig: function() {
                var menuConfig = [
					{
						id: "collapse-button",
						tag: "CollapseMenu",
						className: "Terrasoft.HoverMenuButton",
						style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
						classes: {
							imageClass: ["button-image-size"],
							wrapperClass: ["collapse-button-wrapperEl"]
						},
						imageConfig: resources.localizableImages.collapseIconSvg,
						click: {
							bindTo: "collapseSideBar"
						},
						hint: this.getCollapseSideBarMenuItemCaptionConfig(),
						markerValue: this.getCollapseSideBarMenuItemCaptionConfig()
					}
				];
				return menuConfig;
			}
        });
    }
);

and save the schema.

3) Create the replacing BootstrapModulesV2 view module (or use existing one if you already have it) and add the following content (add created UsrLeftPanelTopMenuModule as a dependency):

define("BootstrapModulesV2", ["UsrLeftPanelTopMenuModule"], function() {
	return {};
});

and save the schema.

4) Reload the page

 

The result will be:

Show all comments

Hello,

I am looking for the name of the "Delete" button in the drop down list menu of a detail. Exactly like in the code below, but instead of the DataGrid delete button, I need the one that is in the detail menu.

define("UsrMyObjectSection", [], function() {

    return {

        entitySchemaName: "UsrMyObject",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[

            {

                "operation": "remove",

                "name": "DataGridActiveRowDeleteAction"

            }

        ]/**SCHEMA_DIFF*/,

        methods: {}

    };

});

 

Thank you!

File attachments
Like 0

Like

1 comments

The function on the detail that you're after is named "deleteRecords". That is what is called from the delete action menu. 

Ryan

Show all comments

Hi

 

Since we upgraded to v8, my default Workplace menu no longer is the default. I have a custom Workplace menu, but when I login, it now uses the Sales Workplace menu instead, meaning I always have to manually change it.

Is there a setting somewhere to allow me to set my default Workplace?

 

thanks

Like 0

Like

3 comments

Hi Mark,

 

Thank you for your question!

 

This is a known issue and our R&D team is already working on implementing a mass fix for future releases. As for now, this can be fixed by enabling the feature DisableAutoFindWorkplace on the instance.

 

For Postgre:

 

do $$

DECLARE

featureCode varchar(100) = 'DisableAutoFindWorkplace';

featureId UUID;

BEGIN

featureId = (select "Id" from "Feature" where "Code" = featureCode limit 1);

IF featureId is null THEN

insert into "Feature"

("Name", "Code")

values

(featureCode, featureCode);

featureId = (select "Id" from "Feature" where "Code" = featureCode limit 1);

end IF;

delete from "AdminUnitFeatureState" where "FeatureId" = featureId;

insert into "AdminUnitFeatureState"

("SysAdminUnitId", "FeatureState", "FeatureId")

values

('A29A3BA5-4B0D-DE11-9A51-005056C00008', 1, featureId),

('720B771C-E7A7-4F31-9CFB-52CD21C3739F', 1, featureId);

end $$;

 

For MS SQL:

 

DECLARE @featureCode varchar(max) = 'DisableAutoFindWorkplace',

 @featureId uniqueidentifier;

set @featureId = (select top 1 Id from Feature where Code = @featureCode);

IF @featureId is null

BEGIN

 insert into Feature

  (Name, Code)

 values

  (@featureCode, @featureCode);

 set @featureId = (select top 1 Id from Feature where Code = @featureCode);

END;

delete from AdminUnitFeatureState where FeatureId = @featureId;

insert into AdminUnitFeatureState

 (SysAdminUnitId, FeatureState, FeatureId)

values

 ('A29A3BA5-4B0D-DE11-9A51-005056C00008', 1, @featureId);

 

Best regards,

Anastasiia

Anastasiia Lazurenko,

Thanks for your quick reply first of all. We use the SaaS Creatio, so is this something I need to raise a case with Creatio support to get applied?

Hi Mark,

 

If you have a Creatio cloud instance, please, check if there is an SQL Executor for Creatio installed. This add-on has been discontinued but if you still have it - you can still use it and run the above-mentioned queries yourself. If it's not present - we can do this on our end. Please, contact us at support@creatio.com in this case.

 

Best regards,

Anastasiia

Show all comments

Hello Community! 

Need add a button in the actions menu into detail. How can i do it?

Regards ,

 

Like 1

Like

1 comments

Sovled! 

addToolsButtonMenuItems: function(toolsButtonMenu) {
	this.callParent(arguments);
 
	toolsButtonMenu.addItem(this.getButtonMenuSeparator());
	toolsButtonMenu.addItem(this.getButtonMenuItem({
	  Caption: this.get("Resources.Strings.MyBoton"),
	  Click: {"bindTo": "OnButonClick"},
	  Visible: {"bindTo": "IsSelectRecord"}
        			}));

 

Show all comments