Is there a way to call a function whenever the current view of the scheduler changes?
You can use LoadData event which is invoked when the current view is changed:
I tried using that, but it triggers the function every second, not only when the view is changed. I want the function to be called only once when I change the view
If I only put a Console.Log it works this way. But I have to call a function that calls a DB procedure, and it does that every second, not only once when I change view
Calling this function every second is definitely not something Scheduler component is doing - you can debug your code to check why the function is called.