Something went wrong on our end
-
Andreas Schindlbeck authoredAndreas Schindlbeck authored
onDelete.js 883 B
import("system.logging");
import("Sql_lib");
import("system.neon");
import("system.calendars");
import("system.vars");
var uid;
if (vars.get("$param.Entry_param") != null)
{
var entry = JSON.parse(vars.getString("$param.Entry_param"));
var reccurenceid = entry[calendars.RECURRENCEID];
if (reccurenceid == undefined)
reccurenceid = null;
uid = entry[calendars.ID];
calendars.removeEntryByUID(calendars.VEVENT, entry[calendars.USER2]["cn"], uid, reccurenceid);
}
else if(vars.get("$field.OWNER"))
{
uid = vars.get("$field.UID");
calendars.removeEntryByUID(calendars.VEVENT, JSON.parse(vars.get("$field.OWNER"))["cn"], uid, vars.get("$field.RECURRENCEID"));
}
/**
* Deletes ApointmentLinks referring to the deleted Appointment.
*/
newWhereIfSet("AB_APPOINTMENTLINK.APPOINTMENT_ID", uid)
.deleteData();