Hi All,
I want to over write the ok button click event of contact edit form.
I am using the below code but it is not working. Please guide me what i am doing wrong in it.
public override bool HookAddCode(object sender, string hookName, params object[] parameters)
{
try
{
switch (hookName)
{
case "FormContactEdit.Load_end":
MessageBox.Show("inside contact edit in plugin");
return true;
default:
return false;
}
}
catch (Exception pcex)
{
return false;
}
}
Method Overwrite Contact Edit Form
Re: Method Overwrite Contact Edit Form
First, if you want to overwrite the method OK click, this:
needs to be this:
Next, your hook doesn't exist in the program. Meaning this:
will never get hit.
To test it, you can build your own version of OD with this:
added to the beginning of butOK_Click in FormContactEdit.
Lastly, to make it so you don't need to keep building and redistributing your own version of OD, you will need to submit a hook request for that hook I just posted.
The pattern for that can be found here
http://opendental.com/manual/patternplugins.html
Code: Select all
public override bool HookAddCode(object sender, string hookName, params object[] parameters)
Code: Select all
public override bool HookMethod(object sender, string hookName, params object[] parameters)
Code: Select all
case "FormContactEdit.Load_end":
To test it, you can build your own version of OD with this:
Code: Select all
Plugins.HookMethod(this,"FormContactEdit_butOK_Click_Start");
Lastly, to make it so you don't need to keep building and redistributing your own version of OD, you will need to submit a hook request for that hook I just posted.
The pattern for that can be found here
http://opendental.com/manual/patternplugins.html