Layout element "Button"

There is a layout element “Button” in the class editor:

You can execute a piece of JavaScript when you click on the button.

My question is: Is it possible to get the object ID or another object property with JavaScript?


The goal is: Click on the button:

(function() { window.location.href = '/showsomething_' + this->**getOoId**; } )

An after the click you will be redirected to /showsomething_5408’

So is there a method like this->getOoId (pseudo-code) to get the actual object ID?


It took a while, but i found the solution by myself :slight_smile:

Sample code, when you click on the button:

(function() {
			var o_id =;
			var link = '' + o_id + '_34';;


Much more easy than to integrate a button in the toolbar

1 Like

JFYI, for those interested, this is how you add button in the toolbar. A bit more complicated, yes, but this way you have the code in a bundle instead of the var/classes.

Yes, there are several objects available and you can refer to the following:


// this.dataFields
// this.layout