Triggers: Difference between revisions

94 bytes removed ,  7 October 2016
m
no edit summary
mNo edit summary
mNo edit summary
Line 457: Line 457:


<source lang="javascript">
<source lang="javascript">
i = intent("android.intent.action.INSERT")                 // Create Intent object for Create Appointment
i = intent("android.intent.action.INSERT")       // Create Intent object
i.data("content://com.android.calendar/events")             // For INSERT event, data contains Google Cal URI
i.data("content://com.android.calendar/events")   // Data contains Google Calendar URI
i.extra("title", entry().field("Title"))                   // Get name of event from the field Title
i.extra("title", entry().field("Title"))         // Get event name from field Title
i.extra("description", entry().field("Description"))       // Get description from the field Description
i.extra("description",
i.extraLong("beginTime", entry().field("Begin").getTime()) // Get start time from the field Begin.
    entry().field("Description"))                 // Get description from field Description
                                                            // Begin is of type DateTime.
i.extraLong("beginTime",
                                                            // Additional parameter is of type Long,
    entry().field("Begin").getTime())             // Get start time from field Begin
                                                            // 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.
                                                  // Additional parameter is of type Long,
                                                            // Requires same conversion as above.
                                                  // so extraLong() is used for conversion.
i.send()                                                   // Send the message
i.extraLong("endTime",
    entry().field("End").getTime())               // Get end time from the field End
                                                  // Requires same conversion as above
i.send()                                         // Send the message
</source>
</source>


== JavaScript links ==
== JavaScript links ==
{{Template:JavaScriptLinks}}
{{Template:JavaScriptLinks}}