Показать сообщение отдельно
Старый 10.02.2022, 19:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
Overload a method for a new button in Form extension
Источник: http://alexvoy.blogspot.com/2022/02/...n-in-form.html
==============

This can be used as a copy-paste pattern, when you need to change a standard method for new form controls added as a form extensions.

At the form initialization step we can overload any form control methods with registerOverrideMethod.
[ExtensionOf(formStr())]
public final class my_MyNewButton_Extension
{
public void init()
{
next init();
// MyNewButton button added in an extension to
FormButtonControl myButton = this.design().controlName(formControlStr(, myNewButton));
// Here we can overload its standard clicked() method in run-time
myButton.registerOverrideMethod(methodStr(FormButtonControl, clicked), formMethodStr(, myNewButtonClicked), this);
}

public void myNewButtonClicked(FormButtonControl _sender)
{

_sender.clicked();
}
}



Check this article for more complicated scenario https://alexvoy.blogspot.com/2018/09...thods-for.html




Источник: http://alexvoy.blogspot.com/2022/02/...n-in-form.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.