Question

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

1 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

Log in or register to comment
Question

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

1 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*/
    };
});

 

Log in or register to comment
Question

Hi community!

How are you?

How could I add a button on row section?

Thanks you!

Regards,

Ezequiel!

Like

1 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

 

Log in or register to comment
Question

 

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

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.

Log in or register to comment
Question

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

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.

Log in or register to comment
Question

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

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.

Log in or register to comment
Question

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

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.

Log in or register to comment
Question

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

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. 

Log in or register to comment
Question

Hello!

how are you?

I hope your can help me!

I have a button in EmployeePage, when I press the button call to method "downloadFile" in property "click". I want call to this method from various bottons but passing a distinct parameter for each button. Example:

{
		"operation": "insert",
		"name": "DownloadFileButton",
		"values": {
			"itemType": 5,
			"imageConfig": {
				"bindTo": "Resources.Images.FilesImage"
			},
			"click": {
				"bindTo": "downloadFile"
                //Pass parameter
			},
			"visible": true
			"enabled": {
				"bindTo": "UsrClaveAltaTemprana"
			},
			//Button Tooltip
			"hint": {  
				"bindTo": "Resources.Strings.MensajeTooltipDownload" 	
			},
			"markerValue": "DownloadFileButton",
			"layout": {
				"colSpan": 1,
				"rowSpan": 1,
				"column": 11,
				"row": 0
			}
		},
		"parentName": "Taba317b6dcTabLabelGridLayout3826b978",
		"propertyName": "items",
		"index": 1
	},
{
		"operation": "insert",
		"name": "DownloadFileButton2",
		"values": {
			"itemType": 5,
			"imageConfig": {
				"bindTo": "Resources.Images.FilesImage"
			},
			"click": {
				"bindTo": "downloadFile"
                //pass parameter
			},
			"visible": true
			"enabled": {
				"bindTo": "UsrClaveBajaTemprana"
			},
			//Button Tooltip
			"hint": {  
				"bindTo": "Resources.Strings.MensajeTooltipDownload" 	
			},
			"markerValue": "DownloadFileButton2",
			"layout": {
				"colSpan": 1,
				"rowSpan": 1,
				"column": 11,
				"row": 1
			}
		},
		"parentName": "Taba317b6dcTabLabelGridLayout3826b978",
		"propertyName": "items",
		"index": 1
	},
//method
methods: {
//method with parameter
			downloadFile: function(parameter) {
             var p = parameter;
             if (p == "A")
               //do some thing
             else
               //do some thing
            }

I appreciated your help!

King Regards!

Ezequiel Gómez

Like

1 comments

Dear Ezaquiel,

The code you've provided above will work in case you add the appropriate Set parameter to UsrClaveAltaTemprana and UsrClaveBajaTemprana.

We suggest you to add the virtual attribute ,though. You can find the example of the attribute in various schemas in the configuration. 

Lisa

Log in or register to comment