SeedCodeComplete2

Adding Fields

Adding fields to Contacts, Projects, Events, etc.

You can expand any of the tables in SeedCode Complete by adding your own fields. Remember, though, that Complete is a Separated solution, so new fields will be defined in SeedCodeData.fp7 but be placed on layouts in SeedCodeComplete.fp7

For example, the contacts table lives in the SeedCodeData.fp7 file. Once SeedCodeComplete is open, grab FileMaker's "Window" menu and select "Show Window / SeedCodeData". Then you can select "Manage / Database" from FileMaker's "File" menu to start defining fields in the contacts table (and any of the other data tables).

How can I add my own fields to the calendar?

Overview

Most of the formatting of how things look in the calendar is done on the Source No X layout (Source No 1, etc.) where you specify which field (perhaps a calc) is used for the Summary-- that is the event attribute we show on all the calendar screens. Using a calc for your Summary field lets you show whatever you like on the calendar (perhaps a user's initials and then the event description, for example).

There are just a couple things to keep in mind as you map fields:

Events with just a single date should have a start date: if your event has just an end date the calendar will fail. The same goes for times: if there is only one time, make it the start time.
Don't use calcs for things like the dates, times, or resources. The calendar wants to edit these values when you drag items around, and it can't edit calcs. Use auto-enter calculations instead if you must.

But on the Day View you have a bit more room and may want to show something besides just the Summary.

Day View & Gantt Chart

You can place any fields from your events table right on then Day view of the calendar, and you can even make these fields enterable if you'd like, but there are a few caveats about that below. (The same is true for the left, white column of the Gantt chart, where the event and project names are.)

Go to the Day or Gantt Tab of the calendar in layout mode (see Editing the Calendar Layouts if you don't know how to get to the day tab in layout mode). Then simply add fields from the CalendarEvents table.

Multiple Data Sources

And, obviously, this only works for one table at a time unless you'd like to set up similar relationships to each of your FileMaker events tables-- if your primary keys are all prefixed, only one relationship will be "true" at a time, so you can stack fields form other events this way. If your primary keys aren't prefixed get in touch with SeedCode as we have some custom solutions that can help with this.

This isn't an issue on the Gantt Chart as that only shows records from Source No 1 anyway.

Enterable Fields

Note that if you allow entry to fields in your events table you may edit information that should cause an event to move or change color. Yet FileMaker won't know to do this just because you edit the field. In such cases you'll need a script trigger on your field (we recommend the OnObjectSave trigger) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.

Changing fields per tab

Can I show different fields on some views of the calendar?

Overview

Yes. The section above describes how you can add your own fields to the Day view, but you can also change what shows up on other views. In this example we'll describe how to set the Month view to show just a field in your events table called "My Field", leaving the other views to show the field(s) you've mapped to the calendar's Summary.

The Modification

Begin by backing up a copy of your file. ;-)

1. Edit the script "Write One FileMaker Event in iCal Format" and find the line where we're setting the variable $scical_Summary.

2. Change that calc from this...

GetField ( $$sc_FieldForSummary )

...to the code below where "SampleEvents" is the name of the table occurrence for Source No 1 in your file, and "SampleEvents::MYField" is the name of the field you wish to show on the month view. Note that the case statement here lets you specify different settings for other views as well, and leaves the mapped field, represented by GetField ( $$sc_FieldForSummary ) as the default for other views and other sources.

Case ( Get ( LayoutTableName ) = "SampleEvents" ; // the table occurrence for Source No 1 Case ( $$sc_Mode = "Month" ; SampleEvents::MYField ; $$sc_Mode = "Week Sched" ; GetField ( $$sc_FieldForSummary ) ; GetField ( $$sc_FieldForSummary ) // Default for other modes ) ; GetField ( $$sc_FieldForSummary ) // Default for other sources/tables )

For your reference, here is a list of all the possible modes in the calendar and the views they represent: Modes In The Calendar.

Note that if you will only ever have one source you can dispense with the Get ( LayoutTableName ) test-- this does add a slight bit of weight to the calendar. If you dispense with this you'd remove the first two lines, and the last two lines from the calc above.

3. At this point, MyField will show up on the month view beside the event's time if there is one. If you'd like to remove the time as well, edit the script "Format Event Time --- Edit Time Formats for Events Here ---". Edit the very last SetVariable statement in the script and you'll see that right at the beginning, on the 4th line, we've commented out a line about the Day View. Uncomment this line changing the mode form "Day Sched" to "Month" and you'll have remove times from displaying on the month view.

Enjoy!

(855) SEEDCODE
[email protected]
Follow us: