Preparing Your File - DayBack for FileMaker

Preparing Your File: Overview

Before you integrate DayBack into your FileMaker solution, you'll need to prepare your file. The actual integration happens within DayBack, where you'll use the admin section to specify how your tables should appear on the calendar. However, the first step is getting DayBack into your solution, which is what this guide covers.

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 FileMaker file means that DayBack becomes part of your file, with its own dedicated layout. After embedding, you can discard the original DayBack example file. There are two ways to embed DayBack:

  • Embedding Using an Add-On: The add-on technology introduced in FileMaker 19 allows you to add new scripts and layouts to your file with a single click. This is by far the fastest and easiest way to integrate DayBack into your solution.
  • Embedding by Hand: This is the traditional method used before FileMaker 19, involving manually copying and pasting scripts, layouts, and other elements into your file. The pasting has to be done in precisely the right order. While more tedious and requiring careful attention to detail, it doesn't take long if you follow the instructions precisely.

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 want the calendar to open in its own window, this method will do that naturally when Dayback is linked.

With this method, you'll keep the DayBack.fmp12 file separate from your main solution, though you can rename it. You'll need to add your own table occurrences to the DayBack.fmp12 file, one for each table you'd like to display on the calendar. Alternatively, you can use DayBack's SampleEvents_DayBack table as your events table, perhaps linking it to existing contacts or projects.

One drawback of linking is that, like all multi-file solutions, you'll need to maintain accounts and privilege sets in both files (unless you configure the calendar file to auto-open with a low-access password for everyone). However, if you're using external authentication, this isn't an issue.


Instructions for Preparing Your File

Before proceeding, make sure to back up your file. Although these instructions are straightforward and add-ons can be easily uninstalled, having a backup allows you to experiment with more confidence and easily revert any changes if necessary. Frequent backups are a good habit and are standard practice among professionals.

Option 1: Embedding Using an Add-On


Option 2: Linking

To link your tables with DayBack, you'll need to add six required fields from DayBack's example table, SampleEvents_DayBack , to the table(s) containing the dates you want to display on your calendar.

Here’s how to proceed:

  1. Copy the Fields: Start by copying the six required fields from the SampleEvents_DayBack table.
  2. Paste the Fields: Paste these fields into your file.
  3. Edit Calculations: Some of the calcs in these fields will need adjustments after pasting. Detailed instructions for these edits can be found here: Copy & Paste Six Required Fields.

After you’ve completed these steps, proceed to step 3 in the integration guide: Integrating DayBack.


Option 3: Embedding by Hand

This is the original method we used before DayBack became an add-on. While it's included here mainly for reference—particularly for those who have used this method in the past—embedding DayBack by hand can still be a viable option.

Overview

Embedding DayBack into your file requires adding new layouts and scripts. Fortunately, most of these components can be copied and pasted from the DayBack example file. While embedding isn’t necessarily "harder" than linking, it does involve more steps. If you follow these instructions carefully and proceed step by step, you’ll be done in no time.

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 when integrating DayBack (or moving any FMP code between files) is performing steps out of order. FileMaker is particularly sensitive to the order in which new code is introduced:

  • Create layouts before pasting scripts that reference those layouts to avoid issues.
  • If you paste a script before its expected layout exists, you’ll end up with broken code that can be difficult to fix.

So, even if you’re an experienced developer, it’s crucial to follow these instructions carefully and in the correct order—at least for your first calendar integration. 😊

Tables

You might not need all six tables from the DayBack example file, but using all of them is the simplest approach. Below are notes on each table and guidance on when and where to paste them:

  • DayBack and DayBackHelper : These tables are absolutely essential. If you’re using the separation model, paste them into your interface file.
  • SampleEvents_DayBack and SampleToDos_DayBack: These are example data tables provided by DayBack. If you already have tables for the data you want to display on the calendar, you may not need these. However, you might still want to paste them in some cases:
    • If you don't yet have a table for To-Dos.
    • If you have a project table but want a separate table for appointments and tasks related to that project, you can paste in SampleEvents and use it as a child of your projects table.
  • SampleContacts_DayBack and SampleProjects_DayBack: You likely won’t need these if you already have tables for contacts and projects. Even if you call your projects "jobs," your existing tables should suffice. However, if you don’t have either contacts or projects tables, you might want to consider SeedCode Complete instead of just DayBack.

Relationship Graph

To set up your relationship graph:

  1. Open the Relationship Graph: Go to File > Manage > Database and navigate to the Relationships tab where you can view the relationship graph for your file.
  2. Create a New Table Occurrence:
    • Click the green plus button in the lower-left corner to create a new occurrence of your events table (the table containing the records you want to display on the calendar).
    • Name this new table occurrence SampleEvents_DayBack (ensure there are no spaces in the table occurrence name). You can rename this later, but keeping it consistent with the scripts you’re about to add will streamline the integration process.
  3. Link Contacts (If Applicable):
    • If you have a separate contacts table, create a new table occurrence of that table and name it SampleContacts_DayBack (again, no spaces).
    • Link this new table occurrence to the SampleEvents_DayBack occurrence using the same field matching you use elsewhere, typically linking the SampleEvent’s contact ID to the unique ID of the contact in SampleContacts_DayBack .
  4. Link Projects (If Applicable):
    • If you have a projects table, create a new occurrence of that table named SampleProjects_DayBack.
    • Link this to the SampleEvents_DayBack table occurrence, usually matching the SampleEvent’s project ID to the unique ID in SampleProjects_DayBack .
  5. Finalizing the Setup:
    • You can rename these table occurrences later, but do so before filling out the field mapping forms inside DayBack.
    • Your relationship graph section should now resemble the one in the DayBack example file.

Fields in Your Events Table

If you imported DayBack's SampleEvents_DayBack table in step 1, you can skip this step, as it already contains all the required fields. However, if you’re using your own events table, you’ll need to add six essential fields from the DayBack example file.

To do this, follow the instructions provided here: Copy & Paste Six Required Fields. Once you’ve added the required fields to your events table, come back to this page and proceed to step 4.

Value Lists

Next, open the DayBack example file and recreate the two value lists used in the example within your own FileMaker file.

  • You can use your own list of statuses and resources, but make sure to name them according to the value list names used in DayBack for now.
  • Unfortunately, FileMaker 19 doesn’t allow you to copy and paste value lists, so you’ll need to recreate them manually.
  • Once you're done, you can rename the lists back to your preferred names later if needed.

Theme & Layouts Part 1

The previous version of DayBack had 22 layouts, while the new version has 13. Although it's fewer, creating these layouts can still take some time, so be patient and work methodically.

Step 1: Import the DayBack Theme

  • Begin by importing the DayBack theme from the DayBack example file into your own FileMaker file.
  • Navigate to File / Manage / Themes in your file and select "Import."
  • Using a consistent theme will make it easier to change the appearance of all these layouts later on.

Step 2: Create Blank Layouts

  • Create a few new blank layouts in your file. (In a later step, you'll paste content into these layouts.) You'll need to create one layout in your file for each layout in DayBack. Even though not all layouts are visible to users in the layout menu, each is required.
    • Creating the First Layout:
      • Start by creating the first layout listed below.
      • In the layout setup, uncheck the box labeled "Show field frames when record is active."
      • Base the layout on the DayBack theme.
      • Also, uncheck the box to enable QuickFind. (You may leave this enabled on the EventList layout if you want to search the calendar using QuickFind, but do this only after you've completed these instructions and have everything up and running.)
    • Duplicating Layouts:
      • Duplicate the first layout you created to make the others.
      • Rename each duplicated layout according to the list below.
      • Ensure the "Show records from" option matches the associated table shown in the list.

Important Notes:

  • Naming Conflicts: Ensure that your file does not already have any layouts or layout folders with the same names as the ones listed below. If there are, please rename your existing layouts or folders before proceeding. FileMaker’s design functions can’t distinguish between a layout and a folder, so a folder named "DayBack" can cause issues.
  • Sample Layouts: You don’t need to create the sample contact and project layouts unless you don’t already have your own.
  • Separator Layouts: You may want to create the separator layouts used in DayBack for aesthetic purposes, but this is optional. Just ensure each layout is based on the correct table occurrence listed below.

Step 3: Delete any default layouts that were created when you imported tables in step 1.

Step 4: Final Check

  • Ensure that all your layouts have exactly the same names as the ones in DayBack.
  • Verify that headers and footers are deleted from layouts that don’t use them.

Scripts

Copy all the scripts from DayBack's example file and paste them into your own FileMaker file. FileMaker might automatically include all new scripts in the ScriptMaker menu, which can clutter the menu. Ideally, this issue will be resolved by the time you read this, but if not, you'll want to remove these scripts from the menu. Only keep the scripts that are exposed in the example file, as those are useful when you're developing.

Check the Import Log:

  • After importing, review the import log. If any scripts are reported as "renamed" due to a conflict, look for script names ending in "2 " and correct them.
  • This renaming shouldn't occur, as all the scripts should have a "_DayBack " suffix, but it’s crucial to verify.
  • It's important that the scripts retain the exact names they have in the DayBack file for the next step to work correctly.

Layouts Part 2

Now it’s time to add content to the blank layouts you created in step 5.

  1. Copy Layout Contents:
    • Go to each layout in the DayBack example file, copy the layout contents, and paste them into the corresponding layout in your file.
    • You may see a warning that the layout height will increase; this is normal and can be ignored.
  2. Adjust Layout Widths:
    • Unlike layout heights, which adjust automatically in FileMaker, layout widths need to be manually adjusted. Move the right edge of each layout to match the position in the example file (usually flush with the rightmost object edge).
  3. Customize the "Event Detail" Layout:
    • The "Event Detail" layout can be customized to fit your needs. Feel free to add your own fields and buttons. You may choose not to use this layout at all, but it’s useful to keep it as a reference since it’s featured in DayBack script examples.
    • If you plan to use this layout, ensure the fields are properly mapped to the corresponding fields in your events table.
  4. Map Fields in Other Layouts:
    • Just as you mapped fields in the "Event Detail" layout, do the same for the "Event List" layout, and also for the "To-Do Details" and "To-Do List" layouts if you're using those. The same applies to project and contact layouts.
    • For now, focus on mapping the basic date, time, and summary fields to ensure the calendar is working. You can return later to complete and refine these layouts.

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