Hi,

is it possible to apply filters to the addRecord button? If so, how can i apply them and execute methods when pressing it.

This print shows the section page with the addRecord button "Novo".

Like 0

Like

1 comments

Dear Pedro,

In order to apply filters to the “addRecord” button please do the following:

1. Create a replacing client schema module. Please find more information in the article by the link below:

https://academy.creatio.com/documents/technic-sdk/7-15/creating-custom-client-module-schema

2. Set “Parent object” property to “Base data view” value https://prnt.sc/psavyp

3. Use the following code as an example:

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

return{

                messages: {},

                mixins: {},

                methods: {                                         

                // new custom method

                TestMethod: function(){

                                return true;

                },

                // overriding addRecord method

                addRecord: function(typeColumnValue){

                var schema = this.getEditPageSchemaName(typeColumnValue);

                if(schema === "AccountPageV2"){

                                // use here your methods or filters

                                this.TestMethod();

                                }

                this.callParent(arguments);

                }

                },

                diff: /**SCHEMA_DIFF*/ [] /**SCHEMA_DIFF*/

                                };

});

 

Please find more information about filters in the article by the links below:

https://academy.creatio.com/documents/technic-sdk/7-14/entityschemaquery-class-filters-handling?_ga=2.100001118.1940880110.1572861922-1199877090.1572861922

https://academy.creatio.com/documents/technic-sdk/7-13/entityschemaquery-filters-handling?_ga=2.5228019.1940880110.1572861922-1199877090.1572861922

4. In case, if it is need to apply a filter only for particular sections, please add a name of these sections to the following part of code:

if(schema === "Section name"){

// use here your methods or filters

                this.TestMethod();

}

 

Please note that it is possible to find the name of the particular section in the query string. For example, for Account section the name is “AccountSectionV2”. Please see the screenshot below:

https://prnt.sc/psb2jp

 

Best regards,

Norton

Show all comments

When I open my page on a large screen the simple info button / user hint appears as desired/correctly:

However, when I minimize the screen or view my page on a smaller screen, the simple info buttons / user hints appear over the top of the boolean field, where as the text field info button remains the same?

How am I able to wrap the info button to the boolean fields?

Like 0

Like

1 comments

Please feel free to modify CSS according to your needs. The article by the link below explains how to add a new CSS class. If you add it to the BootstrapModulesV2 module then it will be loaded after loading the application. 

https://community.bpmonline.com/questions/how-add-custom-style-control-…

Show all comments

Hello. i'd like to hide the 'Run Process' -button in the Side Panel for certain Roles.

As well as change the contents of the drop-down of the 'Home' -button next to it.

Like 0

Like

3 comments

Dear Julius, 

In order to hide the button menu, you need to override the basic functionality, which involves development within the system.

Firstly, you need to override basic schema LeftPanelTopMenuModule. Please find the loadMenu method. There you can see that visibility of the button in based on user type. You can add your custom method to check current user rights and set the visibility based on the response result:

Here is an example of how to check current user role. In the example we are hiding the Menu button form non-administrators role. You can adjust the code up to your needs. (the example involves creating of custom CSS style and adding it to the schema dependencies):

 

As for the list of menu items, please take a look at  loadItemsMainMenu method, which is responsible for its logic.

Hope you will find it helpful.

Regards,

Anastasia

Anastasia Botezat,

 

How do you override the LeftPanelTopMenuModule module? I cannot create a replacing client module, so not sure how I would go about this. Is it no longer possible to do this?

Hi Harvey Adcock,

 

In order to replace "LeftPanelTopMenuModule" client module schema, please follow the steps described below:

 

1. Please go to Configuration > Add > Module

2. In the appeared empty module, please add the code below:

define("UsrLeftPanelTopMenuModule", ["LeftPanelTopMenuModule", "LeftPanelTopMenuModuleResources"],
 function() {
 Ext.define("Terrasoft.UsrLeftPanelTopMenuModule", {
 override: "Terrasoft.LeftPanelTopMenuModuleViewModel",
 /*
 * @override
 */
			...
 });
 }
);

Also, please add Title "UsrLeftPanelTopMenuModule" and Name "UsrLeftPanelTopMenuModule", choose the package. Important: do not set the parent object. Save the module.

 

3. Then, you need to replace "BootstrapModulesV2". Here is the article on how to replace client module schema:

 

https://academy.creatio.com/documents/technic-sdk/7-16/creating-custom-client-module-schema

 

4. In a new replacing client schema, please insert the code below:

 

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

Set "BootstrapModulesV2" as Title and Name, set "BootstrapModulesV2" (NUI) as a parent object, set replace parent input checked. 

 

5. Save the changes and hard-reload the page. 

Show all comments

Hi community!

I add a button section but i want it don't show when I open edit page. In this case, i add a section button on Contact Section. I show images below

Regards,

Thanks you!

Like 0

Like

4 comments

Hello Ezequiel,



You need to define an attribute that will determine the visibility of your button. By default, it will be true. Then you need to override onCardRendered method in your replacing schema for Contact Section and set the attribute as false.

Please, see my example:

 

define("ContactSectionV2", [],

    function() {

    return {

        entitySchemaName: "Contact",

        attributes: {

            "ButtonVisible": {

                "dataValueType": Terrasoft.DataValueType.BOOLEAN,

                "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,

                "value": true

            }

        },

        messages: {},

        methods: {

             onCardRendered: function() {

                 this.callParent();

                 this.set("ButtonVisible", false);

             }

        },

        diff: /**SCHEMA_DIFF*/[

            {

                "operation": "insert",

                "parentName": "ActionButtonsContainer",

                "propertyName": "items",

                "name": "MainContactSectionButton",

                "values": {

                    itemType: Terrasoft.ViewItemType.BUTTON,

                    caption: { bindTo: "Resources.Strings.TestButton" },

                    "visible": {bindTo: "ButtonVisible"},

                    "layout": {

                        "column": 1,

                        "row": 6,

                        "colSpan": 1

                    }

                }

            }

        ]/**SCHEMA_DIFF*/

    };

});

 

Tetiana Markova,

Hi! I wanted to use this code also, but i have a question. Where do I insert the name of my button? 

Tetiana Markova,

 

I don't know if you are still following this thread, but the problem with this method is that when the user closes the edit page the button is not restored to the section list page.  Any solution?

 

Thanks,

The way I got round the above was to include the following method:

			showSection: function() {
				this.callParent();
				this.set("ButtonVisible", true);
			},

This reshows the buttons.  This is purely a hack and unofficial, caveat emptor.

Show all comments

Hi community!

How are you?

How could I add a button on row section?

Thanks you!

Regards,

Ezequiel!

Like 0

Like

2 comments

Please investigate the code in the basesectionv2 module. Please use google chrome dev tools for the investigation.

You can create a replacing client module for the section and add the button in the same way as other buttons were added. 

http://prntscr.com/kqgyym

Additionally, you'll need to override the "onActiveRowAction" method and add a handler for the button. 

http://prntscr.com/kqgzs4

 

Miroslav Kytka,

define("AccountSectionV2", ["AccountSectionV2Resources"], function(resources) {
	return {
		entitySchemaName: "Account",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "MyCustomLockAction",
				"parentName": "DataGrid",
				"propertyName": "activeRowActions",
				"values": {
					"className": "Terrasoft.Button",
					"style": Terrasoft.controls.ButtonEnums.style.BLUE,
					"caption": resources.localizableStrings.UsrLockCaption, 
					"tag": "lock",
					"enabled": true,
					"visible": true
				}
			}
		]/**SCHEMA_DIFF*/,
		methods: {}
	};
});

 

Show all comments

 

I have a case, I want to make two or more buttons on a page.

I've create it, but only one button appears, the second button doesn't appear.

When I refresh the page, a second button appears. Below screenshoot and the code that I use to make these 2 buttons.

Source code in section: 

define("UsrExampleBtn1Section", [], function() {
	return {
        entitySchemaName: "UsrExampleBtn",
        methods: {
            onClickTest1: function() {
                console.log("Test 1 Button Clicked..");
            },
            onClickTest2: function() {
                console.log("Test 2 Button Clicked..");
            },
        },
		diff: /**SCHEMA_DIFF*/[
            /**
             * Element Test Button 1
             */
            {
                "operation": "insert",
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                "propertyName": "items",
                "name": "Test1Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn1Caption"
                    },
                    click: {
                        bindTo: "onClickTest1"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                }
            },
 
            /**
             * Element Test Button 2
             */
            {
                "operation": "insert",
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                "propertyName": "items",
                "name": "Test2Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn2Caption"
                    },
                    click: {
                        bindTo: "onClickTest2"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.GREEN
                }
            },
 
        ]/**SCHEMA_DIFF*/,
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
	};
});

Source code in page:

define("UsrExampleBtn1Page", [], function() {
	return {
		entitySchemaName: "UsrExampleBtn",
        methods: {
            onClickTest1: function() {
                console.log("Clicked Test Button 1");
			},
            onClickTest2: function() {
                console.log("Clicked Test Button 2");
            },
        },
		diff: /**SCHEMA_DIFF*/[
 
			/**
             * Element Test Button 1
             */
            {
                "operation": "insert",
                "parentName": "LeftContainer",
                "propertyName": "items",
                "name": "Test1Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn1Caption"
                    },
                    click: {
                        bindTo: "onClickTest1"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.BLUE
                }
			},
 
			/**
             * Element Test Button 2
             */
            {
                "operation": "insert",
                "parentName": "LeftContainer",
                "propertyName": "items",
                "name": "Test2Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn2Caption"
                    },
                    click: {
                        bindTo: "onClickTest2"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.GREEN
                }
			},
		]/**SCHEMA_DIFF*/,
	};
});

Is there something wrong in my code? I have checked the console, but there is no error. any solution for my case? Thanks



*SOLVED

Add all button caption in section and page

Like 1

Like

4 comments

Dear Romadan,

It seems you have forgot to add the caption "TestBtn2Caption" in Section schema.

I have added the same buttons with 2 captions both in Section and Page schemas and they are displayed correctly, but once I delete the caption in Section schema I was able to see the same results - the second button was appearing only after I refresh the page.

Please check the caption in the Section schema and make sure it is added correctly.

Oleh

 

I check caption 'TestBtn2Caption' in schema, and I forgot to add.

Thanks Oleh.

 

Dear Romadan & Oleh,



This case is same with my problem.

Thank you for this post and solved very helpful.



Ali

Dear Romadan,

Don't forget about me.

Show all comments

Hi community!

How are you?

I hope you can help me!

How can I add a button in row datagrid of Products? I add a image below showing in red color where I need add the button!

King Regards,

 

Ezequiel

Like 0

Like

1 comments

Please investigate how the "activeRowActionOpenCard" button was added into the "SupplyPaymentDetailV2" module. Please feel free to create your own container and apply your CSS in order to create the left button. The handler for the buttons is in the "onActiveRowAction" method in the "ConfigurationGridUtilities" module. Please put a breakpoint and click on the button on a record in the "Installment plan" detail on the "Order" page. You'll see how to handle the click. Please note that you can override the "onActiveRowAction" method on the detail schema. 

Please read bpm'online development guide for more information.

Show all comments

Is it possible to put a button (or custom link) on the side bar, where sections are? If it's not possible with the current framework - do you think it would break something if such button was placed there using jQuery?

Like 0

Like

2 comments

Dear Carlos,

You may try add a usual custom section, put it at any workplace you want and then override init function in section module:

init: function() { window.location.href = "http://bpmonline.com"; }

After clicking on this section http://bpmonline.com page will be opened.

If everything works fine you can delete all unnecessary code created by Section Wizard leaving only the needed one to your section work properly.

You may add everything on the page using jquery but you should be careful with it. Of course you can break something if do it in a wrong way but it's related to any code that developers write.

Thank you very much, it worked.

Show all comments

Need to add a button on the accounts page next to a new text field.  Something similar to the web field in the communications options:

I need to be able to enter a text value like: “asd234” into the field to be stored as an “external account id”. 

Then be able to click the button at the end to display a webpage in another tab with an url like:

https://somewebsite.com/asd234

I was planning on using a System Setting to store the URL root https://somewebsite.com/ and then just append the “external account id” field.

I envision the button click code to be something like (pseudo code):

If (account.externalaccountid <> '') {
	Var URL = get-system-setting(“external website root”) + 
              account.externalaccountid;
	DisplayWebPage(URL);
}

NOTE: the functionality of the Web field is what I want except that I need it in another section under “billing” and need to store just the “external account id” – not the whole URL.

 

Like 0

Like

1 comments

Dear Brian,

How to add a button to any place of the page is described here.

The example with communication options from your screenshot you will find in the ContactCommunicationDetailV2 schema:

{

                    "operation": "insert",

                    "name": "CommunicationsContainer",

                   ...

                    {

                       ...

                        onGetItemConfig: "getItemViewConfig"

                    }

...

The code above fills in the communication container with input and button elements by calling getItemViewConfig function. You can read that function to see, how it creates the buttons with images and clicks.

Show all comments

Hello!

I hope you can help me!

I want to hide the "Contact" button from the Quick Add Menu

How could I do this?

King Regards,

Ezequiel

Like 0

Like

1 comments

Hi,

There is the lookup called  Quick Add menu setup:

Image.png



You can apply the necessary changes there. Please note that you need to log out and back it for the changes to be applied. 

Show all comments