Can I execute methods from within Servoy fields?

Yes you can. Use an html_area, set it to non-editable and then it can trigger Servoy methods by using html links.

Example:
Put this in the html area:

<html>
<a href="javascript:dialog_test("hi")">click here to run script</a>
</html>

You can pass arguments to your methods, in the example above we are passing “hi” to the method we are calling. In the method you are calling you can parse out the parameters. Create a method name dialog_test with the following contents:

var receivedArgument = arguments[0]
plugins.dialogs.showInfoDialog( "Info","The argument you passed is: " + receivedArgument )

It will show a dialog with the arguments you passed it.

Hi,

Can I use labels to trigger a script instead of using the global fields?

I placed a label/button on the form. I entered the html text in text property of the label. But it seems the method is not triggered.

But when I use global fields as per the instructions in this post the method is triggered.

I’m just wondering to avoid creating lot of global fields for these things (I have so many buttons where I need to use HTML). I think it would be easier if we can simply enter the HTML in the text property of a label/button

Am I going stupid???

Thanks

Presently you can only use globals.
You can reuse a globals if you need to set many.