Page 1 of 1

Refreshing Apptbook programmatically

Posted: Tue Jul 23, 2019 9:55 am
by wjstarck
I used to do this in my plugin by looping through the controls from FormOpendental like so but this no longer works.

Code: Select all

        public static void RefreshModuleData(FormOpenDental sender) {   //Performs dynamic appointmentbook refresh

            foreach (Control control in sender.Controls) {
                if (control.Name == "ContrAppt") {
                    ContrAppt ContrAppt2 = new ContrAppt();
                    ContrAppt2 = (ContrAppt)control;
                    ContrAppt2.RefreshPeriod();
                }
            }

        }
How can I refresh the Apptbook programmatically?

Re: Refreshing Apptbook programmatically

Posted: Tue Jul 23, 2019 11:30 am
by cmcgehee
We've been rewriting the appointment module to improve its performance. There is now a class named ContrApptJ which is the new appointment module. There is a preference 'ApptModuleUses2019Overhaul'; if true, ContrApptJ will be used. If false, ContrAppt will be used. I believe you'll have to look for either ContrApptJ or ContrAppt and call RefreshPeriod. You may need to check that preference to decide which one to refresh.

Re: Refreshing Apptbook programmatically

Posted: Tue Jul 23, 2019 11:55 am
by wjstarck
Thanks Chris.

I'm confused though. I'm looping through all the controls from sender (FormOpenDental) from my plugin's ContrApptA. I don't see ContrAppt (or ContrApptJ) in the list of controls. Shouldn't ContrAppt and/or ContrApptJ be in the list of controls from FormOpenDental?

Re: Refreshing Apptbook programmatically

Posted: Tue Jul 23, 2019 12:11 pm
by cmcgehee
This might be due to the patient dashboard we added in 19.1. Instead of adding the module controls directly to FormOpenDental, we now add them to FormOpenDental.splitContainerNoFlickerDashboard.Panel1.

Re: Refreshing Apptbook programmatically

Posted: Tue Jul 23, 2019 12:58 pm
by wjstarck
OK I'll look there thanks

Re: Refreshing Apptbook programmatically

Posted: Wed Jul 24, 2019 3:57 pm
by wjstarck
Got it, but could you make the RefreshPeriod() method public on ContrApptJ so I can access it?

Thanks

Re: Refreshing Apptbook programmatically

Posted: Thu Jul 25, 2019 8:14 am
by cmcgehee
Could you use reflection to invoke it?

Re: Refreshing Apptbook programmatically

Posted: Thu Jul 25, 2019 2:06 pm
by wjstarck
Will give that a try.

Thanks Chris