Adding Fields
SeedCodeComplete2.AddingFields History
Hide minor edits - Show changes to output
Added lines 13-18:
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.
-> 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.
Changed lines 19-26 from:
CalendarEventUIDCalc_FirstValue = _id
Where _id is the primary key (the unique ID)
Next go to the Day or Gantt Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file
to:
Go to the Day or Gantt Tab of the calendar in layout mode (see [[Calendar Tabs | 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.
Changed lines 57-65 from:
$$sc_Mode = "Week Sched" ; GetField ( $$sc_FieldForSummary ) ;
GetField ( $$sc_FieldForSummary ) // Default for other modes
)
; GetField ( $$sc_FieldForSummary ) // Default for other sources/tables
to:
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
)
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
)
Added lines 5-6:
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).
Added lines 1-4:
!! 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 [[Separation Model | Separated]] solution, so new fields will be defined in SeedCodeData.fp7 but be placed on layouts in SeedCodeComplete.fp7
You can expand any of the tables in SeedCode Complete by adding your own fields. Remember, though, that Complete is a [[Separation Model | Separated]] solution, so new fields will be defined in SeedCodeData.fp7 but be placed on layouts in SeedCodeComplete.fp7
Changed lines 9-14 from:
'''Day View'''
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.
To add a field to the day view, create a relationship from CalendarRows to SampleEvents like this:
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
To add a field to
to:
'''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.)
To add a field to the day or gantt view, create a relationship from CalendarRows to SampleEvents like this:
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.)
To add a field to the day or gantt view, create a relationship from CalendarRows to SampleEvents like this:
Changed lines 19-22 from:
Next go to the Day Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Next, change the Refresh Window step at the end of the "Refresh Calendar..." script to use the Fluch Cached Join Results option. If you're on a Mac you can leave it like this but if you're on windows or want the best possible performance you can wrap it in an If statement so it uses the Flush option only when $$sc_Mode = "Day Sched" and uses a regular refresh elsewhere.
Next, change the Refresh Window step at the end of the "Refresh Calendar..." script to use the Fluch Cached Join Results option. If you're on a Mac you can leave it like this but if you're on windows or want the best possible performance you can wrap it in an If statement so it uses the Flush option only when $$sc_Mode = "Day Sched" and uses a regular refresh elsewhere
to:
Next go to the Day or Gantt Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Added lines 25-26:
This isn't an issue on the Gantt Chart as that only shows records from Source No 1 anyway.
Added lines 21-22:
Next, change the Refresh Window step at the end of the "Refresh Calendar..." script to use the Fluch Cached Join Results option. If you're on a Mac you can leave it like this but if you're on windows or want the best possible performance you can wrap it in an If statement so it uses the Flush option only when $$sc_Mode = "Day Sched" and uses a regular refresh elsewhere.
Added lines 60-61:
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.
Changed line 29 from:
! Changing the fields that display per tab
to:
! Changing fields per tab
Changed lines 32-35 from:
'''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. ;-)
'''The Modification
to:
'''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. ;-)
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. ;-)
Changed lines 42-43 from:
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.
to:
...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.
Changed lines 29-30 from:
! Can I show different fields on some views of the calendar?
to:
! Changing the fields that display per tab
!! Can I show different fields on some views of the calendar?
!! Can I show different fields on some views of the calendar?
Changed lines 29-30 from:
to:
! Can I show different fields on some views of the calendar?
Changed lines 35-38 from:
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...
2. Change that calc from this...
to:
'''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...
'''2.''' Change that calc from this...
Changed lines 41-43 from:
to this...
Case (
Case
to:
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 (
Case (
Changed line 46 from:
$$sc_Mode = "Month" ; SampleEvents::Status ;
to:
$$sc_Mode = "Month" ; SampleEvents::MYField ;
Changed lines 51-57 from:
)
to:
)
For your reference, here is a list of all the possible modes in the calendar and the views they represent: [[Modes In The Calendar]].
'''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!
For your reference, here is a list of all the possible modes in the calendar and the views they represent: [[Modes In The Calendar]].
'''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!
Changed lines 27-51 from:
to:
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.
!! 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 this...
Case (
Get ( LayoutTableName ) = "SampleEvents" ; // the table occurrence for Source No 1
Case (
$$sc_Mode = "Month" ; SampleEvents::Status ;
$$sc_Mode = "Week Sched" ; GetField ( $$sc_FieldForSummary ) ;
GetField ( $$sc_FieldForSummary ) // Default for other modes
)
; GetField ( $$sc_FieldForSummary ) // Default for other sources/tables
)
!! 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 this...
Case (
Get ( LayoutTableName ) = "SampleEvents" ; // the table occurrence for Source No 1
Case (
$$sc_Mode = "Month" ; SampleEvents::Status ;
$$sc_Mode = "Week Sched" ; GetField ( $$sc_FieldForSummary ) ;
GetField ( $$sc_FieldForSummary ) // Default for other modes
)
; GetField ( $$sc_FieldForSummary ) // Default for other sources/tables
)
Changed lines 13-16 from:
To add a field to the day view, first go to the Day Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is to allow you to add fields right from your events table to the daily view. This relationship is true only if there are no are overlapping events: if there are, we don't show any individual fields.
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is
to:
To add a field to the day view, create a relationship from CalendarRows to SampleEvents like this:
CalendarEventUIDCalc_FirstValue = _id
Where _id is the primary key (the unique ID) in your events table. All this relationship is for is to allow you to add fields right from your events table to the daily view.
Next go to the Day Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
CalendarEventUIDCalc_FirstValue = _id
Where _id is the primary key (the unique ID) in your events table. All this relationship is for is to allow you to add fields right from your events table to the daily view.
Next go to the Day Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Changed lines 23-25 from:
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.
You'll see that the status field in our calendar example is set up this way.
You'll see that the status field in our calendar example is set up this way
to:
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.
Changed lines 23-24 from:
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 OnObjectSave) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.
to:
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.
Changed lines 5-8 from:
Most of the formatting of how things look in the calendar is done on the Source No X layout(s) 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).
But on theDaily View you have a bit more room and may want to show something besides just the Summary.
But on the
to:
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).
But on the Day View you have a bit more room and may want to show something besides just the Summary.
But on the Day View you have a bit more room and may want to show something besides just the Summary.
Changed lines 15-16 from:
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is to allow you to add fields right from your events table to the daily view. This relationship is true for the first event (if there are are overlapping events) and for the first row of the event's time (if the event spans multiple rows).
to:
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is to allow you to add fields right from your events table to the daily view. This relationship is true only if there are no are overlapping events: if there are, we don't show any individual fields.
Changed lines 23-25 from:
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 OnObjectSave) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.
to:
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 OnObjectSave) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.
You'll see that the status field in our calendar example is set up this way.
You'll see that the status field in our calendar example is set up this way.
Changed lines 13-14 from:
To add a field to the day view, first go to the Day Tab of the calendar in layout mode (see [[EditLayouts | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
to:
To add a field to the day view, first go to the Day Tab of the calendar in layout mode (see [[Calendar Tabs | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Changed lines 3-5 from:
Other Views
to:
'''Overview'''
Most of the formatting of how things look in the calendar is done on the Source No X layout(s) 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).
But on the Daily View you have a bit more room and may want to show something besides just the Summary.
'''Day View'''
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.
To add a field to the day view, first go to the Day Tab of the calendar in layout mode (see [[EditLayouts | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is to allow you to add fields right from your events table to the daily view. This relationship is true for the first event (if there are are overlapping events) and for the first row of the event's time (if the event spans multiple rows).
'''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.
'''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 OnObjectSave) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.
Most of the formatting of how things look in the calendar is done on the Source No X layout(s) 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).
But on the Daily View you have a bit more room and may want to show something besides just the Summary.
'''Day View'''
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.
To add a field to the day view, first go to the Day Tab of the calendar in layout mode (see [[EditLayouts | Editing the Calendar Layouts]] if you don't know how to get to the day tab in layout mode). Then simply add fields from your event table-- that would be a field from Sample Events in the original calendar file.
Note that we have a relationship from Calendar Rows to Sample Events: all this relationship is for is to allow you to add fields right from your events table to the daily view. This relationship is true for the first event (if there are are overlapping events) and for the first row of the event's time (if the event spans multiple rows).
'''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.
'''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 OnObjectSave) that will call the script "Refresh Calendar { UseExistingData ; DontRefresh }". Don't send any parameters to the script.
Added lines 1-5:
!! How can I add my own fields to the calendar?
Day View
Other Views
Day View
Other Views