Chain of Command at Form button

Hi Friends,

I found this piece of code in google, How to write COC extensions on Form button.

We normally use Pre and Post event handlers but I am trying to understand Chain of Command on Form buttons.

As highlighted in yellow, Do I need to create a separate class for writing some price of code on this button.

If I have 5 buttons and I want to write COC then do i need to create 5 classes for these 5 buttons.

**********(All I am talking is considering a form already exist like “SalesTable” form and I want to implement COC on that form buttons , assume 5 buttons. Do I need to proceed

creating 5 classes or any alternative approach exist)*********

Please tell your comments.

[ExtensionOf(formControlStr(MyForm, Button1))]

final class FormButton1_Extension


public void clicked()


next clicked();

// do something here



That’s correct, but it’s usually not needed. Buttons are usually linked to menu items and you want to add logic to what they call, not to buttons as such. Or they are command buttons and you can react to event triggered by these commands. Or they are regular buttons calling other methods and you can use CoC on those methods. Or you can react to button’s OnClick event instead of using CoC.

Thanks Martin.