Dialog Field event in D365

Below is example to overwrite modified event of dialog field.

Step 1 : Write modified method logic in class.

[ExtensionOf(classStr(Test))]

Final Class Test_Extension

{

public boolean postingButtonModified(FormCheckBoxControl _checkbox)
{

// Custom Logic to be callsed

return _checkbox.modified();
}

}

 

Step 2: Overwrite dialogPostRun method and register modified event.

public void dialogPostRun(DialogRunbase tmpdialog)
{
next dialogPostRun(tmpdialog)

// Register Method and pass class name and your method name to be called.
dlgPosting.registerOverrideMethod(methodStr(FormCheckBoxControl,  modified),methodStr(Test_Extension, postingButtonModified), this);
}