General X++ Development
How do I execute code when a form opens in D365FO?
How do I execute code when a form opens in D365FO?
1 answer
Write an answerExtend the form's init() method when the logic is form-level.
[ExtensionOf(formStr(MyForm))]
final class MyForm_Extension
{
public void init()
{
next init();
// Your initialization logic.
}
}If what you are initializing belongs specifically to a datasource, put the logic on the datasource instead. Keeping logic close to what it affects makes the form a lot easier to maintain.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer