PatientSelected Event Not Firing

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
FernandoJB
Posts: 6
Joined: Fri Aug 20, 2010 9:39 am
Location: Framingham, MA
Contact:

PatientSelected Event Not Firing

Post by FernandoJB » Fri Aug 20, 2010 9:46 am

Hi, i found a dificulty making a plugin, when the user Clicks "Select Patient" button, it wont Fire the PatientSelected event, it only fires when clicking patient name on the Family Grid.

I added a button to the ContrFamily Toolbar, and need to know when the patient is selected or changed to Activate / Deactivate the Button based on Selected Patient Information.

is this by design? its a bug? is there any other way to intercept the Selection of a Patient ?

Thanks.

Fernando.

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: PatientSelected Event Not Firing

Post by jordansparks » Sat Aug 21, 2010 12:39 pm

The patient selected event passes information up from the Family module to the main FormOpenDental. However, the top toolbar is part of FormOpenDental, not part of the Family module. You will see that the top toolbar is constant across all modules because it's not part of the modules. But that even is not meant to trigger a refresh inside of a module. It's only purpose it to tell the main form that a patient has changed. This won't necessarily cause any visible effect. What you really want to do is respond to the ModuleSelected method being called. For example, you could put your code at the end of RefreshModuleScreen after all the data objects are guaranteed to have been refreshed. Maybe like this:
ToolBarMain.Buttons["MyButtonName"].Enabled=false;
Jordan Sparks, DMD
http://www.opendental.com

User avatar
FernandoJB
Posts: 6
Joined: Fri Aug 20, 2010 9:39 am
Location: Framingham, MA
Contact:

Re: PatientSelected Event Not Firing

Post by FernandoJB » Mon Sep 13, 2010 10:16 am

Can you put a Hook at the end of RefreshModuleScreen for ContrFamily ?

michael
Posts: 38
Joined: Wed Aug 04, 2010 8:49 am

Re: PatientSelected Event Not Firing

Post by michael » Thu Sep 16, 2010 6:28 am

Hook was added yesterday. It will be available for use with version 7.2.41.

You are welcome.

Post Reply