Multiple Sources
DayBackForFileMaker.MultipleSources History
Hide minor edits - Show changes to markup
Since you've already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, replace the entire contents of the original DBk_WebviewerSource calculated field with the following case statement:
Since you've already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, replace the entire contents of the original/existing DBk_WebviewerSource calculated field with the following case statement:
Since you've already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, modify the original DBk_WebviewerSource field as a Case statement, like so:
Since you've already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, replace the entire contents of the original DBk_WebviewerSource calculated field with the following case statement:
Lastly, update the Settings scripts as described in steps 4 and 5 above, and run the Upon Opening script. Your records from this table will be available on the calendar twice!
Lastly, update the Settings scripts as described in steps 4 and 5 above, and run the Upon Opening script. Your records from this table will be available on the calendar twice!
With the fields set up, completing the addition of the second source is much like adding a source from another table (although a bit easier). Duplicate the Source No 1 layout and rename it Source No 3. Map the date and time fields that correspond with this source. Since the same base table occurrence is used for this source, no other fields need to be remapped, unless you have Status or Resource (or other) fields uniquely corresponding to these dates.
We also need a set of DBk_TimestampStartCalcNum and DBk_TimestampEndCalcNum fields for each source. Rename the fields by appending "1" to each field name (these will continue to be used for source 1). Then duplicate them, naming the duplicates DBk_TimestampStartCalcNum3 and DBk_TimestampEndCalcNum3. In these calc fields for source 3, map the date and time fields that correspond with this source.
With the fields set up, completing the addition of the second source is much like adding a source from another table (although a bit easier). Duplicate the Source No 1 layout and rename it Source No 3. Map the date, time, and DBk_TImestamp fields that correspond with this source. Since the same base table occurrence is used for this source, no other fields need to be remapped, unless you have Status or Resource (or other) fields uniquely corresponding to these dates.
If you haven't already, follow the Integration instructions to add a source using your first set of Date/Time fields. With the one source working, duplicate the �DBk_WebViewerSource� field twice (one for each source). With the To-Do List set as Source Number 2, let�s call these fields �DBk_WebviewerSource1" and "DBk_WebviewerSource3".
Since you�ve already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, modify the original DBk_WebviewerSource field as a Case statement, like so:
If you haven't already, follow the Integration instructions to add a source using your first set of Date/Time fields. With the one source working, duplicate the "DBk_WebViewerSource" field twice (one for each source). With the To-Do List set as Source Number 2, let's call these fields "DBk_WebviewerSource1" and "DBk_WebviewerSource3".
Since you've already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, modify the original DBk_WebviewerSource field as a Case statement, like so:
If you wanted the source to only show up for some users, you could wrap the "Source No 2" section in the script "Load Source Settings at Startup --- Describe Your Sources Here ---" in an If() statement so that source was only described for some users.
If you wanted the source to only show up for some users, you could wrap the "Source No 2" section in the script "Load Source Settings at Startup --- Describe Your Sources Here ---" in an If() statement so that source was only described for some users.
Can I toggle on/off sources within a script?
This is not currently a built-in option, but you *can* override which sources get loaded into the calendar. Since this customization won't actually toggle the active sources in DayBack's sidebar, it's best implemented only when you've added a custom sidebar.
First, within the "Load Calendar Settings - On Startup" script, make sure all your sources are set to active (see "How do I determine which sources show up by default?" section above).
Then, modify the "Event Find" script by adding a Set Variable step just after the $assign_parameters Set Variable step. This step should set the $$sc_SourcesActive variable to the list of your desired active source numbers, so this will depend on how you're tracking/choosing which sources should appear active.
With these changes added, you'll be able to script which sources are "active" without needing to manual toggle sources on the built-in calendar sidebar.
Lastly, update the Settings scripts as described in steps 4 and 5 above, and run the Upon Opening script. Your records from this table will be available on the calendar twice!
Lastly, update the Settings scripts as described in steps 4 and 5 above, and run the Upon Opening script. Your records from this table will be available on the calendar twice!
How can I delete a source or hide it from some users?
All you need to do is change the name of the Source No 2 layout to "Unused No 2". And then quit FileMaker and reopen DayBack.
It can be a little confusing because the source descriptions are stored as global variables and these can hang out, once defined, until you close the solution and reopen it. But DayBack's script "Load Source Settings at Startup --- Describe Your Sources Here ---" looks for the layout's containing "Source No" in their name so changing the name short circuits this while leaving the code in place so you can easily add that source back if you'd like.
If you wanted the source to only show up for some users, you could wrap the "Source No 2" section in the script "Load Source Settings at Startup --- Describe Your Sources Here ---" in an If() statement so that source was only described for some users.
\\
Can I have multiple sources from the same base table?
Yes! You might want to, for example, display two distinct sets of Dates/Times from a Jobs or Projects table. (However, in many cases, using a related table to handle multiple dates makes the most sense. For more info on this, see step 1 of Quick Integration).
If you haven't already, follow the Integration instructions to add a source using your first set of Date/Time fields. With the one source working, duplicate the �DBk_WebViewerSource� field twice (one for each source). With the To-Do List set as Source Number 2, let�s call these fields �DBk_WebviewerSource1" and "DBk_WebviewerSource3".
Since you�ve already set up the first source, DBk_WebviewerSource1 does not need any modification. Now, map the appropriate date and time fields in the DBk_WebviewerSource3 calc. Make sure that the sc_sourceNumber variable matches your new source number. Next, modify the original DBk_WebviewerSource field as a Case statement, like so:
With the fields set up, completing the addition of the second source is much like adding a source from another table (although a bit easier). Duplicate the Source No 1 layout and rename it Source No 3. Map the date and time fields that correspond with this source. Since the same base table occurrence is used for this source, no other fields need to be remapped, unless you have Status or Resource (or other) fields uniquely corresponding to these dates.
Lastly, update the Settings scripts as described in steps 4 and 5 above, and run the Upon Opening script. Your records from this table will be available on the calendar twice!
Creating a Second FileMaker Source
Creating a New FileMaker Source
So that's what happens when you just ask to create an event without specifying anything further: that is, when you shift-click in the calendar or click the "+ new" button. The calendar does, however, have an API that will let you make your own "+" button to create events in any source you want. You can use this to make a "new todo" button, for example. You'd do this by calling the script "Create Edit Delete Event ( SourceNo )..."
So that's what happens when you just ask to create an event without specifying anything further: that is, when you double-click in the calendar. The calendar does, however, have an API that will let you make your own "+" button to create events in any source you want. You can use this to make a "new todo" button, for example. You'd do this by calling the script "Create Edit Delete Event ( SourceNo )..."
- zscEventSummaryCalczscTimestampEndCalcNumzscTimestampStartCalcNum
- If you want to show event colors in list view as we do in the Event List or Event Detail layouts, copy our field "z_ColorCalc" from Sample Events and add it to your "Orders" table mapping our field "status" to the equivalent field in your table: this is the field we used to color code events in the calendar. Note that the calendar shares the same list of statuses and resources across all sources.
How does the calendar decide which source to use for a new event?'
How does the calendar decide which source to use for a new event?
Creating a Second FileMaker Source.
Creating a Second FileMaker Source
Source Limitations
The Gantt Chart can only depict records from the first source and unlike other views it won't show records from more than one source at the same time.
How do I determine which sources show up by default?
Edit the script "Load Calendar Settings - On Startup --- Edit Configuration Here ---" and find the comment "Which sources are active by default". If you want your source to be shown in the calendar at startup, add its number to the List () function after that comment. If you don't do anything here your source will show up as a possible source on the Calendars tab, but its events won't show in the calendar unless a user elects to click on that source.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source for your jobs table where you show job due dates on the calendar.
The calendar ships with an example second source, a To-Do List, to show you how this works. You can toggle this second source off and on by visiting the "Sources" tab in the calendar's left hand sidebar.
DayBack, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source for your jobs table where you show job due dates on the calendar.
The calendar ships with an example second source, a To-Do List, to show you how this works. You can toggle this second source off and on by visiting the "Calendars" tab in the calendar's left hand sidebar.
Note that having multiple sources can show up in the calendar's speed as there are more records to draw, but this FM12 calendar is much faster at drawing multiple sources than our previous versions have been.
Note that having multiple sources can show up in the calendar's speed as there are more records to draw, and additional Find requests to perform: displaying fewer events at one time will always be faster. So you can have as many sources as you want, but try not to show them all at once by default.
How can I show records from more than one table in the same calendar?
How can I show records from more than one table in the same calendar?
Firstly, if there is only one source showing, when you create an event the calendar will create it in that source.
First, if there is only one source showing, when you create an event the calendar will create it in that source.
How does the calendar decide which source to use for a new event?'
Firstly, if there is only one source showing, when you create an event the calendar will create it in that source.
When multiple sources are showing we look to see if the "default sources for new events" is one of them. If it is, we create the event in that source. You can specify this default source toward the top of the script "Load Calendar Settings - On Startup --- Edit Configuration Here ---".
If this default source is not one of the ones showing, we create the event in the first source showing.
So that's what happens when you just ask to create an event without specifying anything further: that is, when you shift-click in the calendar or click the "+ new" button. The calendar does, however, have an API that will let you make your own "+" button to create events in any source you want. You can use this to make a "new todo" button, for example. You'd do this by calling the script "Create Edit Delete Event ( SourceNo )..."
Read the comments at the head of that script to learn more about how to use it to make new events.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source for your jobs table where you show job due dates on the calendar.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources. Our Pro calendar comes with a To-Do List as a second example source.
One you set up multiple sources, users can turn sources off and on using the Sources tab in the left hand sidebar.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source for your jobs table where you show job due dates on the calendar.
The calendar ships with an example second source, a To-Do List, to show you how this works. You can toggle this second source off and on by visiting the "Sources" tab in the calendar's left hand sidebar.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources.
- You'll also want to add the following auto enter calc to your TimeStart field (if you don't have a time start field, create one):
- You'll also want to add the following auto enter calc to your TimeStart field (if you don't have a time start field, create one). Same thing with TimeEnd--make one and use this auto-enter calc:
Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) ;
Self )
- Make sure you uncheck the "Do not replace existing value" checkbox. This Auto-Enter option is needed if you want events to be able to start at midnight.
Self = Time ( 0 ; 0 ; 0 ) ; Time ( 0 ; 0 ; 1 ) ;
Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) + 1 ;
Self )
- Make sure you uncheck the "Do not replace existing value" checkbox. This Auto-Enter option is needed if you want events to be able to start or end at midnight.
Source Limitations
The Gantt Chart can only depict records from the first source and unlike other views it won't show records from more than one source at the same time.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source by your jobs table where you have job due dates.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources. Our Pro calendar comes with a To-Do List as a second example source.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source for your jobs table where you show job due dates on the calendar.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources. Our Pro calendar comes with a To-Do List as a second example source.
Note that having multiple sources can show up in the calendar's speed as there are more records to sort and draw.
Note that having multiple sources can show up in the calendar's speed as there are more records to draw, but this FM12 calendar is much faster at drawing multiple sources than our previous versions have been.
You'll find Source counts below comments "Abstract for sources" in the following scripts:
- Insert iCal File Into Calendar { UseExistingData }Click in / Drag Eventin the first Set Variable after the comment "Create a new record"Clear iCal VariablesClear Source VariablesClear iCal Parsing Variables
iCal Sources
Overview.
You create a new iCal source in much the same way as you create a FileMaker source, it is just a lot simpler since almost all the work is done on the Source No X layout.
Regarding our iCal Example.
The URL we use for our example is from John's yoga studio. This iCal only returns events for the "next two weeks" (the yoga studio has set it up that way). So if you're looking at our sample data in November of 2009 you won't see any iCal events. Navigate to "today" and then click on the "Yoga Schedule" on our Sources tab to see how this works.
Caveats.
iCal sources can really slow the calendar down, however, especially if you refresh them frequently (there is a "refresh every" X hours attribute on the Source No X layout to help alleviate this) or if your URL has a ton of records in the past. You might start by editing the iCal example we have (editing the Source No 2) layout to see if the iCal source you're interested in is fast enough.
Grabbing an iCal URL also requires a plugin. We're using the free ScriptMaster plugin for this and you can download a copy here: https://www.360works.com/scriptmaster/ Follow the installation instructions that come with the plugin.
Adding an iCal source.
Troubleshooting.
If you're having trouble getting your iCal source to show up, here are a few tips:
You'll find Source counts below comments "Abstract for sources" in the following scripts:
- Case (
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) ;
- Case (
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ;
Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) ; \\
// v 5.09
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources.
You can even have sources that aren't FileMaker tables by creating sources that represent iCal URLS. In this way you can mix events from an iCal URL among your FileMaker records.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources. Our Pro calendar comes with a To-Do List as a second example source.
Note that having multiple sources can show up in the calendar's speed. So be judicious as to how you use this.
Note that having multiple sources can show up in the calendar's speed as there are more records to sort and draw.
- z_sc_TimestampEndCalcz_sc_TimestampStartCalc
- zscEventSummaryCalczscTimestampEndCalcNumzscTimestampStartCalcNum
- If ( Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; Self )
- Case (
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) ; Self )
// v 5.09
iCal sources can really slow the calendar down, however, especially if you refresh them frequently (there is a "refresh every" X hours attribute on the Source No X layout to help alleviate this. You might start by editing the iCal example we have (editing the Source No 2) layout to see if the iCal source you're interested in is fast enough.
iCal sources can really slow the calendar down, however, especially if you refresh them frequently (there is a "refresh every" X hours attribute on the Source No X layout to help alleviate this) or if your URL has a ton of records in the past. You might start by editing the iCal example we have (editing the Source No 2) layout to see if the iCal source you're interested in is fast enough.
Troubleshootig.
If you're having trouble getting your iCal source to show up, here are a few tips:
- '' in the first Set Variable after the comment "Create a new record"
''--> Clear iCal Variables
- in the first Set Variable after the comment "Create a new record"
Clear iCal Variables
- Clear iCal Variables
- Click in / Drag Event'' in the first Set Variable after the comment "Create a new record"
''--> Clear iCal Variables
A couple thoughts.
Regarding our iCal Example.
The URL we use for our example is from John's yoga studio. This iCal only returns events for the "next two weeks" (the yoga studio has set it up that way). So if you're looking at our sample data in November of 2009 you won't see any iCal events. Navigate to "today" and then click on the "Yoga Schedule" on our Sources tab to see how this works.
Caveats.
Coming soon.
Overview.
You create a new iCal source in much the same way as you create a FileMaker source, it is just a lot simpler since almost all the work is done on the Source No X layout.
A couple thoughts.
iCal sources can really slow the calendar down, however, especially if you refresh them frequently (there is a "refresh every" X hours attribute on the Source No X layout to help alleviate this. You might start by editing the iCal example we have (editing the Source No 2) layout to see if the iCal source you're interested in is fast enough.
Grabbing an iCal URL also requires a plugin. We're using the free ScriptMaster plugin for this and you can download a copy here: https://www.360works.com/scriptmaster/ Follow the installation instructions that come with the plugin.
Adding an iCal source.
Note that having multiple sources can show up in the calendar's speed. So be judicious as to how you use this.
Note that having multiple sources can show up in the calendar's speed. So be judicious as to how you use this.
iCal Sources
Note that having multiple sources can show up in the calendar's speed. So be judicious as to how you use this.
- z_sc_TimestampEndCalcz_sc_TimestampStartCalc
iCal Sources
One you set up multiple sources, users can turn sources off and on using the Sources tab in the left hand sidebar.
asfv
Each source in the calendar is represented by a layout. You'll see a couple of these layouts in the calendar's example file: they are names "Source No 1" and "Source No 2". Any new sources you create will need a layout named the same way.
Here is how you'd create a new FileMaker source...
Coming soon.
Overview.
Traditionally a portal can only show records from one table occurrence, though it can include fields from other table occurrences related to the one the portal is based on.
This calendar, however, can include events from completely unrelated tables--each of which becomes a "data source" for the calendar. In this way you might have one source be an events table holding things like followup calls, meetings, etc. And have a second source by your jobs table where you have job due dates.
You can even have multiple sources from within the same table: if, for instance, you had a job due date in your jobs table and a followup date in your jobs table, you'd create those as two separate sources.
You can even have sources that aren't FileMaker tables by creating sources that represent iCal URLS. In this way you can mix events from an iCal URL among your FileMaker records.
Creating a Second FileMaker Source.
asfv
How can I show records from more than one table in the same calendar?
Coming soon.
iCal Sources
Coming soon.