Create Events
Can I make event records from outside the calendar, such as from portals on my other layouts?
Absolutely. In fact, you'll see that we do this on the Contacts layout where we have a "new event" button towards the lower right. That button calls one of the scripts in the calendar specifically set up to receive commands from your other layouts (or even other files).
The script is called "Create Edit Delete Event ( SourceNo ) { Operation , DateStart , DateEnd , TimeStart , Resource... }" and it can take any number of parameters to let you manipulate events using your own scripts.
In our script from the Contacts' record we send the following parameters to create a new record for the contact we're looking at:
Read the comments at the beginning of this script to learn about other parameters you can send to this script.
What about editing events?
You can edit events the same way, read about the "Operation" parameter at the beginning of this script to see how you can have it edit a record as well as create one.
Can I extend this script to take new parameters?
Of course! Just as you're likely adding new fields to the events table (If you're a doctor, you may add a field for "symptoms", for example), you'll likely want to add those new fields to this script in the form of new parameters. Here's how, taking "symptoms" as an example:
- If [ not isempty ( $sc_Status )]Set Field [ CalendarEvents::Status; $sc_Status]End if
Bring up an event for the user to see.
As with creating events, we have a simple script you can use to show an event as well. This is much easier than try to write a GoToRelatedRecord statement each time you'd like to view an event (and managing the window state in that GTRR, etc.)
Pass the event's ID into the script "Show Events Details ( SourceNo ; ID ; DateStart )" following the instructions at the beginning of the script. In SeedCode Complete your SourceNo will always be "1" unless you've created multiple sources.