Page 1 of 1

Setting ApptType changes frontmost tab: can it be done?

PostPosted: Sat Feb 09, 2008 11:30 am
by jimrecht
Hi John:
Several months ago you helped me implement a mod that does the following: when the user selects a given tab in the MiniWindowEditAppt window, the current appointment is set to the corresponding appointment type. For example, by selecting the "Evaluation" tab, I also set the current appointment type to "Eval." Here's the link, just to job your memory:

http://seedcode.com/support/viewtopic.php?t=1352&highlight=

Now, I'd like to do something like the reverse. I'd like to have a way to switch to the appropriate tab, based on the ApptType of the current appointment.

For example: when I go to the "Contacts" layout, to the "Appointments" tab, I see a portal containing all of that patient's appointments. I click on one, which brings up the MiniWindowEditAppt window, and now I can scroll through all of that patient's appointments from within that window. The problem is that, when I scroll from an "Evaluation" appointment to a "Routine Office Visit" appointment, the frontmost tab remains the same, even though the appointment type has changed. As a result, I'm unable to view some of the data (because my "Evaluation" tab contains fields that are not on my "RoutineVisit" tab and vice versa).

In other words: is there a way to "tell" the MiniWindowEditAppt window which type of appointment is currently active, then select the appropriate tab?

PostPosted: Sat Feb 09, 2008 12:20 pm
by John Sindelar
Sure thing Jim. First you'll probably want a separate script that does to the correct tab based on the appointment's type.

Just a one line script with GoToObject where the object name is a calc like this...

Case (
CalDailyAppointments::ApptType_kf = "Evaluation" ; "SomeTab" ;
CalDailyAppointments::ApptType_kf = "Routine Office Visit" ; "SomeOtherTab" ;
)

...where "SomeTab" and "SomeOtherTab" are the object names of your tabs.

Now you just need to call this from the right places.

To switch tabs when "scrolling" between records, call this new script inside the script "Edit Appointment - Continue ( Action )" in the "$Action ≠ "Continue"" section after the GoToRecord/Request/Page Previous step and after the GoToRecord/Request/Page Next step.

To arrive at the right tab when editing an appointment call it within the "Edit Appointment { Column , Type }" script in place of the GoToObject statement already there after the "Go to the Default Tab" comment. Do the same to the script "Edit Appointment from External".

Hope that helps.