Executing another script when an event is created or modifie

Notes on our latest calendar for FileMaker 13,: DayBack
Posts: 11
Joined: Fri Apr 24, 2015 1:02 pm
PostPosted: Mon Feb 15, 2016 11:51 am
How can I execute another script when an event is created or modified?

I'd got a couple of potential things that I'd like to do after an event is either created or is modified. I've looked through the documentation but I can't see anything there that explains how to call another script.

I need the Event ID (which appears to be inside of $sc_EventID. I see that this is available for records that are being edited or deleted but not for records that are being created. I'm guessing that I'll have to create my own variable that will store the results of the event ID after the event has been created.

I'd also like the action being performed: i.e. is this is new event or an edit to an existing event. I believe that is found inside of $sc_Operation.

So my question is where do I put the Perform Script step if I want to call a script of my own using these two values. My educated guess would be near the end of DayBack's Create Edit Delete Event script. Just above the block for Generate Output for result... It's there where I would have to check to see if $sc_EventID is blank and if so, get the value from the Event ID field.

Am I correct?
SeedCode Staff
SeedCode Staff
Posts: 190
Joined: Tue Sep 22, 2015 2:27 pm
PostPosted: Mon Feb 15, 2016 3:57 pm
Great questions here!

You have quite a bit of freedom to edit the "Create Edit Delete Event..." script. There are different sections of this script which execute based on the $sc_Operation being performed. At line 118 of this script, you'll see a new section begins if the operation is Create or Edit. You might choose to add your script within this If section, since both creation and edits are covered here.

Also, there is a section just for "Create" at about line 83. Here, we create a new Event record, so the new event ID should be available immediately after the New Record script step. You could add a Set Variable step to capture the Event ID here in $sc_EventID. That way, this variable will be populated for your added script, whether the operation is Edit or Create.

I hope this helps! Keep me posted if you have any other questions on this.

Return to DayBack Calendar for FileMaker

Who is online

Users browsing this forum: No registered users and 4 guests

(855) SEEDCODE
[email protected]
Follow us: