Question

Adding custom buttons to edit pages

I tried to add a custom button to an edit page, so I inserted the following code to the diff array:

{
	"operation": "insert",
	"parentName": "LeftContainer",
	"propertyName": "items",
	"name": "CustomButton",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.CustomButtonCaption"},
		"classes": {"textClass": "actions-button-margin-right"},
		"click": {"bindTo": "customAction"},
		"style": Terrasoft.controls.ButtonEnums.style.GREEN,
		"tag": "custom",
		"markerValue": "CustomButton"
	},
	"visible": true,
	"index": 4
}

The button is shown if I enter the edit page directly by coping and pasting its URL or refreshing the page but if I enter it from the section's main page, it is not shown. Do you know how to fix this problem?

Like 0

Like

4 comments

Hello!

You need to add the following button to the section schema as well and you will see the button you need.

Matt

I tried to do that and my code in UsrCustomEntitySection.js is:

 

{
	"operation": "insert",
	"parentName": "SeparateModeActionButtonsLeftContainer",
	"propertyName": "items",
	"name": "CustomButton",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.CustomButtonCaption"},
		"classes": {"textClass": "actions-button-margin-right"},
		"click": {"bindTo": "customAction"},
		"style": Terrasoft.controls.ButtonEnums.style.GREEN,
		"tag": "custom",
		"markerValue": "CustomButton",
	},
	"index": 4
}

The button appears on the section page but still not on the edit page (except when reloading it).

Carlos Zaldivar Batista,

Hello.

Please make sure you have done the necessary modifications according to the article below:

https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-button-…

Matt

Matt Watts,

Ok, thank you, it works. I didn't find this article myself.

Show all comments