Page 1 of 1

Deactivate DayBack Window popping up in front

PostPosted: Mon Dec 03, 2018 12:42 pm
by muntinga
Dear Seedcode and Forum Users,

I have a script which I run in an event window:

Set Field [ Appointments::Status ; "SZ abgerechnet" ]
Perform Script [ “Jump to Patient - via Appointment” ]

It sets the status field with a specific text, and then activates the script "Jump to Patient" ->

Set Field [ Praxis::ContactID_Zwischenspeicher ; Appointments::id_contact ]
Perform Script [ “Close Event Window & Refresh Calendar” ]
Open File [ Open hidden: Off ; “TheraTool2” ]
Perform Script [ “Go To Patient from within the Calendar” from file: “TheraTool2” ]

This script copies the event ID, closes the event window, opens another FM File (my custom solution called "TheraTool2"), and then activates a script within that file which searches for a specific patient connected with the event above.

Question:
No matter what I do, the DAYBACK window always pops up in front, although I just opened the other file and intend it to remain in the focus... can I suppress that "coming in front" of DayBack?

THANK YOU!!!

Best, Edward

Re: Deactivate DayBack Window popping up in front

PostPosted: Mon Dec 03, 2018 3:48 pm
by kcembrey
Hi Edward,

Thanks for the details on what you're experiencing. This is happening because the "Close Event Window & Refresh Calendar" tells the DayBack WebViewer to refresh. Once the WebViewer receives this request, it then uses the FMP URL to call a couple other scripts to retrieve the calendar data. This happens at a bit of a delay, so if your scripts are still running when the calendar is refreshing, it will not run its scripts until your scripts finish, which means the calendar refresh will be the last thing to run, which will bring the focus back to the calendar.

To account for this, you can call the "Close Event Window & Refresh Calendar", then set your "Go To Patient from within the Calendar" script to run at a delay (start with 6-seconds, then try less time if desired) using an "Install OnTimer" script step. This will allow the calendar to refresh first, then your script to go to the patient record will run, leaving the user at the patient record window last.

I hope that helps! Let me know if you have any further questions.

Regards,

KC

Re: Deactivate DayBack Window popping up in front

PostPosted: Tue Dec 04, 2018 1:47 am
by muntinga
that sounds great! that explains a lot.... thnx will try!!!!