Debugging
Any tips for debugging scripts in the calendar?
Everyone has their own debugging techniques but here are a few tips specific to this calendar.
1. Use script debugger. The script debugger in FileMaker Advanced is really essential for following along with scripts as they're executing, you can tell if your script is on the layout you think it is, and importantly, what variables are available to you at any point in a script (via the data viewer).
2. Run the script "Dev ON". This will set a flag preventing the calendar from clearing the (many) variables used to parse events, leaving all this in the data viewer. You'll also be able to see the SQL queries used. The key variables used are:
$$sc_Query1 and $$sc_Query2: the two SQL queries used to find the events that show up in the calendar. in most integrations you change the fields passed INTO these queries (by manipulating the "Source No X" layouts) and don't change the queries themselves.
$$sc_iCal and $$sc_iCal_Summary: these are the raw results of Query1 and 2, respectively. If these are missing, then there were no events found for the current date range and filters. If the value in either is "?", then there was a problem with the syntax of the SQL queries.
$$sc_Array... the four array variables are the textual representation of the calendar and are the data source for the calendar's display.