This topic contains 5 replies, has 3 voices, and was last updated by admin 8 years, 4 months ago.
-
AuthorPosts
-
July 20, 2016 at 12:53 pm #72694
The local variables from my Action Script don’t seem to be correct. After creating the event in the calendar (all server side), I simple email myself the local variables and then stop the script from proceeding. These are my results:
$event_type: new
$event_id: 1469031184391
$from: 07/20/2016 14:30:00
$to: 07/20/2016 15:30:00
$from_utc: null
$to_utc: null
$text: Description Text
$unit (resource name): 350F78E68C164878A6EB8992D8E78BC7
$readonly: null
$script: null
$url: null
$untimed: nullThe largest issue is $event_id. Your docs say a new event should return the key from fm or random for existing event. The above example shows a random number for $event_id. I tried creating new events in both FM and Web Direct several times and only once did that variable have the actual event_id in it. All others were random numbers. When I push this new event to Google Calendar I can’t act on the call back from Google because I don’t have the event ID. Searching for Date and Time and Resource to try to find the event is both in accurate (two events at the same time, same day, same person) and a lot of hassle. Is this a bug?
The $from_utc and $to_utc are never populated.
$text variable. This is a bit confusing to me. My expectation is that there is a Title(summary) field and Description field. SoSimple only has this one editable $text field. It would be nice to have both the title and description fields editable on the event entry screen. Seems very odd that the title of the event is hard coded in a script and only the description is readily editable. Especially since the Title(summary) field is what’s displayed in the calendar view. Am I looking at this wrong?
$url variable. This also didn’t populate when creating a new event in Web Direct.
Lastly, it would be really nice if you split up $to and $from into Start Date, Start Time, End Date, End Time.
-
July 21, 2016 at 7:06 pm #72738
Hi there –
We have been busy at DevCon this week – we’ll take a look at this in the next couple of days and let you know what’s happening.
Thanks
Ken
-
July 23, 2016 at 1:00 pm #72881
Hi –
I’ve had a chance to look over your post, and run some tests. The script seems to be running as expected.
The design of the script is to provide any variables that you might need when editing or creating an event in the web viewer. The script runs server-side right after the record is created or edited in FileMaker. soSIMPLE passes all the data that is potentially generated from the calendar, or identifies the event in the calendar.
However, since the record is the current record in FileMaker when that step is executed, you can get the data from the current record on that script step by passing the field name directly. When we edit existing events ($event_type=”edit”), the $event_id will match what’s in your database. When we create a new event, the $event_type=”new” and the $event_id is a random ID from soSIMPLE. Once the event is written to your FileMaker file, the event id field is changed to your event id. To get that ID, you pull it from your own record like this:
"event_type: " & $event_type & ¶ & "event_id: " & $event_id & ¶ & "new id: " & calendar_data::Event_ID & ¶ & "from: " & $from & ¶ & "to: " & $to & ¶ & "from_utc: " & $from_utc & ¶ & "to_utc: " & $to_utc & ¶ & "text: " & $text & ¶ & "unit: " & $unit & ¶ & "readonly: " & $readonly & ¶ & "script: " & $script & ¶ & "url: " & $url & ¶ & "untimed: " & $untimed & ¶ & "lat: " & $lat & ¶ & "lng: " & $lng
Likewise for other fields such as the description.
You can also break out the timestamp field by using:
getasdate($from)
andgetastime($from)
For other fields:
$unit will show whatever data is stored in your resource field. If you use IDs for the resources, that’s what will be passed. You can get the resource name from your FileMaker record.
$url is intended to show what’s after the #hashtag on the url. It can be used to redraw the web viewer on platforms that can’t read it directly from getobjectproperties(). It doesn’t appear to be passed server-side – we’ll look into this.
$from_utc and $to_utc should show the UTC mean time for the $from & $to variables. They don’t appear to work server-side either – we’ll look into those.Please let me know if this helps, or if you have any other questions.
Thanks
Ken
-
July 25, 2016 at 11:47 am #73048
MattHi Ken, thanks for the detailed response, that was very helpful. It wasn’t obvious to me at first but your reply straightens things out.
To recap:
On creation SoSimple will have a random ‘event_id’ and pass that along. However, since the record has already been created by the time this Action Script runs, the ‘id’ field for the event will already have it’s proper ID entered. The SoSimple Action Script won’t pass that ID with the other variables in the script but I can grab it, and other fields from that event, because it is the active event record in FM. Then, like you said, I grab the ‘id’ field value via the field name (or whatever field value I like). Got it.“event_id: ” & $event_id & ¶ &
“new id: ” & calendar_data::Event_ID & ¶ &Thanks again,
Matt -
July 25, 2016 at 1:05 pm #73049
MattKen, can you address this please? It got lost in the shuffle…
$text variable. This is a bit confusing to me. My expectation is that there is a Title(summary) field and Description field. SoSimple only has this one editable $text field. It would be nice to have both the title and description fields editable on the event entry screen. Seems very odd that the title of the event is hard coded in a script and only the description is readily editable. Especially since the Title(summary) field is what’s displayed in the calendar view. Am I looking at this wrong?
-
July 25, 2016 at 1:22 pm #73050
The recap is correct.
To followup on the $text variable – this follows the same logic. soSIMPLE is only including variables that can be changed from the calendar. Since the default web window and the inline event editor can only change the ($text variable) that is the only one we pass. Typically, the more detailed description field is calculated by your FileMaker solution, so it’s not useful to pass as a variable since it would have changed by the time the script step is run.
Instead use your FileMaker field to get the description.
-
AuthorPosts
You must be logged in to reply to this topic.