Preparing Your File - DayBack for FileMaker

Preparing Your File: Overview

Once you've prepared your file, you'll do the real integration inside DayBack, using the forms and drop-downs in the calendar's admin section to declare how you'd like your tables to show up on your calendar. But first, you need to get DayBack into your solution, and that's what this page of instructions is for.

There are two approaches to integrating DayBack with your existing FileMaker file: embedding and linking. 

Two Options: Embedding vs Linking

Embedding DayBack

Embedding the calendar into your file means the calendar ends up as a layout (its own layout, not part of an existing layout) in your file so you'll discard the DayBack example file when you're done. Embedding can be accomplished in two ways:

Embedding Using an Add-On

The new add-on technology in FileMaker 19 lets you add new scripts and layouts to your file with one click. This is by far the fastest way to add DayBack to your solution.

Embedding by Hand

This is the old, pre-19 method to add new scripts, layouts, etc. to your file: copying and pasting. The pasting has to be done in precisely the right order so this is a bit more tedious integration process but if you follow our instructions carefully it doesn't take that long.

Linking DayBack

Linking is the second fastest way to get DayBack working with your solution since you don't need to make new scripts or layouts in your file. If you often want the calendar to appear as its own window, it does that naturally when linked.

When you link DayBack to your file, you'll keep the DayBack.fmp12 file as a separate file in your solution, though you may rename it. You'll add your own table occurrences to the DayBack.fmp12 file, one for each table you'd like to see on the calendar. Or you'll use DayBack's SampleEvents_DayBack table as your events table, perhaps linking it to contacts or projects you already have.

One downside to a linked file is that, like all multi-file solutions, you'll need to have your accounts and privilege sets in both files (unless you set the calendar file to auto-open with its own, low access password for everyone)-- that's the only downside of linking And if you're using external authentication, then it's no downside at all.


Instructions for Preparing Your File: Embedding Using an Add-On

Backup your file before continuing. These instructions are pretty easy to follow--and add-ons can be easily uninstalled--but having a backup means you can take more risks and easily undo your work if you need to. All the pros backup frequently: it's a great habit to get into.

Watch the video here showing how to install DayBack as an add-on: DayBack's FileMaker 19 Add-On

Please download the add-on here: http://dayback.com/filemaker-calendar-add-on/

Once the add-on is in your file and you can see events in DayBack, continue with step 3 here to get your records in the calendar: Integrating DayBack.


Instructions for Preparing Your File: Linking

Backup your file before continuing. These instructions are pretty easy to follow, but having a backup means you can take more risks and easily undo your work if you need to. All the pros backup frequently: it's a great habit to get into.

All you'll need to do is add DayBack's six required fields to the table(s) whose dates you'd like to see in your calendar. You'll copy these fields from DayBack's example table: SampleEvents_DayBack. 

Once you paste the fields into your file, a few of the calcs require some editing: you'll find instructions here: Copy & Paste Six Required Fields

After you've pasted and edited these fields, continue with step 3 here: Integrating DayBack


Instructions for Preparing Your File: Embedding by Hand

This is the old technique we used before DayBack was an add-on. This is only here for reference: for those customers who used this method in the past.

Embedding the DayBack takes a little more work as you'll need to add new layouts and scripts to your file. Fortunately, most of these things can be copy and pasted from the DayBack example file. So embedding isn't "harder" than linking, it's just a bit more tedious. But if you follow these instructions in order and don't rush ahead, you'll be done in no time.

Here we go.

Backup your file before continuing. These instructions are pretty easy to follow, but having a backup means you can take more risks and easily undo your work if you need to. All the pros backup frequently: it's a great habit to get into.

Keys to Success

The most common mistake folks make integrating DayBack (or moving any FMP code from file to file) is performing steps out of order. FileMaker is very sensitive to the order in which new code is pasted into a file--create layouts before you paste in a script looking for that layout and all will be well; paste the script in before the layout expected in that script has been created and you'll have some busted code that is particularly hard to unravel.

So, even if you're an experienced developer, follow the steps here carefully and in order--at least for your first calendar integration. =)

1. Tables

You may not need all six tables from the DayBack example file, but that's certainly simplest. Here are some notes on each of the tables and where to paste them.

DayBack and DayBackHelper are absolutely required. If you're using the separation model, these get pasted into your interface file.

SampleEvents_DayBack and SampleToDos_DayBack. These are DayBack's example data tables: you may very well have tables for the data you'd like to see in the calendar. But you may want to paste these as well in some cases. Maybe you don't have a table to To-Dos yet? Maybe you have a project table but want a table for the appointments and tasks related to that project: you'd paste in SampleEvents and use that as a child of your projects table.

SampleContacts_DayBack and SampleProjects_DayBack you probably don't need because you already have tables for these. You may call your projects, "jobs," but if you have neither contacts or projects you may be more interested in SeedCode Complete than DayBack.

2. Relationship Graph

Select File / Manage / Database and navigate to the Relationships tab where you can see the "relationship graph" for your file. Click the little green plus button in the lower-left to create a new occurrence of your events table (the table that has the records you want to see on the calendar) and name it "SampleEvents_DayBack" (make sure there are no spaces in the table occurrence name). You can change this name later, but having this name match the scripts you're about to add makes the whole integration work.
If you have a separate table of contacts you can create a new table occurrence of that as well and name it "SampleContacts_DayBack" (again, with no quotes or spaces in the name). Link this to the SampleEvents_DayBack table occurrence you just created using the same field matching you use elsewhere: this is likely from the SampleEvent's contact ID to the unique ID of the contact in SampleContacts. Do the same with projects, if you have projects, creating a new instance of Projects named "SampleProjects" and link it to SampleEvent's project ID. You can rename these table occurrences once you're done but before you fill out the field mapping forms inside DayBack.
You can relate "SampleEvents_DayBack" to your projects or jobs table the same way: just name your instance of projects/jobs "SampleProjects_DayBack" without the quotes. You can rename this table occurrence once you're done with the steps here but  before you fill out the field mapping forms inside DayBack.
When you're done here, this new section of your relationship graph should look like the one in the DayBack example file.

3. Fields in Your Events Table

If you pasted in DayBack's SampleEvents_DayBack table in step 1 above then please skip this step: it has all the required fields in it. If you're pointing DayBack at your own events table, however, you'll need to copy and paste six required fields from the example file into your events table.

Follow the instructions here and then return to this page, and to step 4 below, when you're done: Copy & Paste Six Required Fields

4. Value Lists

Open the DayBack example file and recreate the two value lists from our example in your file. Feel free to use your own list of statuses, resources, but rename them to the value list names we're using in DayBack: you can name them back later. Sadly there is no way to copy and paste value lists in FileMaker 19. 

5. Theme & Layouts Part 1

The previous version of DayBack had 22 layouts. This new version has only 13, but it can still take a while to create them, so take your time.

Before creating your layouts, import the DayBack theme from the DayBack example file. Go to File / Manage / Themes in your file and select "Import". Down the road, you can change the way all these layouts look: having a theme for them will make that process easier.

Next, begin by creating a few new blank layouts in your file. (We'll paste in content for these layouts in a subsequent step.) You'll create one layout in your file for each layout in DayBack (even though only some layouts are visible to users in the layouts menu, all these layouts are required). This is most easily done by creating the first layout listed below, deleting the header and footer part, and duplicating it to create the others. 
Note. It is important that you don't already have any layouts (or layout folders) with the same name as any of the layouts below. If you do, please rename your layouts or folders before continuing. ( FMP's design functions can't tell the difference between a layout and a folder, so a folder named "DayBack" will cause problems also.)
Here is how to create that first layout: Create the layout and then visit Layout Setup and uncheck the box beside "Show field frames when record is active". Base the layout on the DayBack theme. Also, uncheck the box to enable QuickFind. (If you want to search the calendar using QuickFind you can leave this enabled on the EventList layout. Do this after you've followed these instructions and are up and running.) Keep duplicating and renaming layouts making sure to switch "Show records from" to match the associated table shown in the list below.
Again, you don't need to add the sample contact, and project layouts unless you don't have any of your own. 
You may want to create the separator layouts we have as well (these are based on DayBack) but that is just cosmetic. Make sure each layout is based on the table occurrence shown below.

Finally, delete the default layouts created when you imported tables in step 1 above.

Once you're done, go through and make sure these layouts have exactly the same names as the ones in DayBack, and that the headers and footers are deleted from each layout that doesn't utilize those parts. 

6. Scripts
Copy and paste all the scripts from DayBack's example file. For some reason, FileMaker wants to include all new scripts in the ScriptMaker menu but hopefully, that will be fixed by the time you read this. If not you'll want to remove these script the menu, leaving the ones that we've exposed in the example file as those can come in handy when you're developing.
Check the import log: If any scripts are reported as being "renamed" because of a conflict, quickly scan the imported scripts for names ending "2" and correct them. This shouldn't happen since all the scripts have a "_DayBack" suffix, but be sure to check. Our scripts must have the same names as they do in the DayBack file for the following step to work.
7. Layouts Part 2
Here's where we'll add the contents to the blank layouts you created in step 5.
Copy the layout contents from each layout in the DayBack example file and paste them into the layout of the same name in your file. You'll be warned that you'll be increasing the height of each layout; that's OK. 
While the layout heights in FileMaker take care of themselves automatically, the layout widths do not. You'll need to manually move the right edge of the layout out to the same place it is on the layouts in our file (for most layouts this is flush with the rightmost object edge).
When you get to "Event Detail" feel free to edit this layout as you see fit, adding your own fields and buttons. You may choose not to use this layout at all, but you may want to have it for reference as its used in DayBack script examples. You can come back and edit this layout later, for now, if you do intend to use this layout just make sure the fields properly match up with the relevant fields in your events table.
Just as you needed to click on fields on Event Details and point them at the proper fields in your table, you'll need to do the same to the Event List layout, and the on the To-Do Details and To-Do list, if you're using those. Same with projects and contacts. Again, you can map the basic date, time, and summary fields now so you know the calendar is working. You can always come back here and finish cleaning these layouts up.
8. That's it
That's the end of the tedious stuff. Congratulations! Backup your file one more time (don't overwrite your last backup) and then move on to the fun stuff, continuing with step 3 here: Integrating DayBack