Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The control does not add the new appointment for you. You are responsible for adding the new appointment using the AddAppts method. The reason for this is that appointments require unique keys and cannot generate these automatically.

...

The final parameter, ApptToCopy, will have a value if the user is attempting to create a new appointment by CTRL+Dragging an existing one. In this case, ApptToCopy will be set to the key of the appointment the user dragged. You are still responsible for adding the appointment copy. Do this by first reading the source appointment's Appt property. Update the start and end times, give it a new key, and call AddAppts.

Example

Code Block
Transfer Param1 to EntityID
Transfer Param2 to StartDateTime
Transfer Param3 to EndDateTime
Transfer Param4 to ApptToCopy
Transfer Param5 to Shift
Transfer Param6 to Ctrl
Transfer Param7 to Alt

If ApptToCopy EQ "" then
   // New appointment
   NewAppt = EntityID:@VM:GetNextApptID():@VM:StartDateTime:@VM:EndDateTime:@VM:RGB(127, 0, 0):@VM:RGB(255, 255, 255):@VM:"New Appt":@VM:"This is a new appt."
end else
   // Copy an appointment
   NewAppt = Get_Property(@Window:".OLE_SCHEDULE", "OLE.Appt[":ApptToCopy:"]")
   NewAppt<1> = EntityID
   NewAppt<2> = StartDateTime
   NewAppt<3> = EndDateTime
   NewAppt = Insert(GetNextApptID(), 2, 0, 0)  ;// We need a new key in position 2
   Convert @FM to @VM in NewAppt
end

// Add it
rv = Send_Message(@Window:".OLE_SCHEDULE", "OLE.AddAppts", NewAppt)

See Also

BeforeNewApptDragCancelNewApptDragBeforeNewApptDrop