Triggers: Difference between revisions

175 bytes added ,  6 October 2016
m
no edit summary
mNo edit summary
mNo edit summary
Line 451: Line 451:
<source lang="javascript">
<source lang="javascript">
i = intent("android.intent.action.INSERT")                  // Create Intent object with action Create Appointment
i = intent("android.intent.action.INSERT")                  // Create Intent object with action Create Appointment
i.data("content://com.android.calendar/events")            // For INSERT event, data contains Google Calendar URI
i.data("content://com.android.calendar/events")            // For INSERT event, data contains Google Cal URI
i.extra("title", entry().field("Title"))                    // Get name of event from the field Title
i.extra("title", entry().field("Title"))                    // Get name of event from the field Title
i.extra("description" , entry().field("Description"))       // Get description of event from the field Description
i.extra("description", entry().field("Description"))       // Get description from the field Description
i.extraLong("beginTime" , entry().field("Begin").getTime()) // Get start time from the field Begin. Begin is of type DateTime.
i.extraLong("beginTime", entry().field("Begin").getTime()) // Get start time from the field Begin.
                                                             // Additional parameter is of type Long, so extraLong() is used for conversion.
                                                            // Begin is of type DateTime.
i.extraLong("endTime" , entry().field("End").getTime())     // Get end time from the field End. Requires same conversion as above.
                                                             // Additional parameter is of type Long,
                                                            // so extraLong() is used for conversion.
i.extraLong("endTime", entry().field("End").getTime())     // Get end time from the field End.
                                                            // Requires same conversion as above.
i.send()                                                    // Send the message
i.send()                                                    // Send the message
</source>
</source>