Search code examples
c#lotus-noteslotus-dominolotusscript

Recurring calendar entries in Lotus Notes


Does somebody know if it is possible to change one of documents in a series of recurring meetings? I changed one of them with c# api and it changed all documents in the series (e.g. 5 docs in series will be modified during one save() call)

var document = view.GetFirstDocument();
if (document != null)
{
    do
    {
        var item = document.GetFirstItem("Repeats");
        var repeat = tmpItem != null ? Convert.ToInt32(tmpItem.Text) : 0;

        if(repeats)
        {
            document.ReplaceItemValue("myVal", "1"); //it change all my 5 docs after first save
            document.Save(true, false);
        }
        document = view.GetNextDocument(document);
    }
    while (document != null);
}

Solution

  • From "Lotus Notes Calendar and Scheduling explained! Part 1":

    the instance document of a repeating meeting can be split into multiple documents if the chair reschedules some instances. Consider a repeating meeting that repeats once a week for five weeks. If the chair advances the first and second instance by an hour, the single response document for all five instances is now split into two response documents: one for the first and the second instance and another for the remaining instances.

    And from the "IBM Lotus Notes and Domino Calendaring & Scheduling Schema":

    Repeating events are scheduled more than once over time and are represented by at least two notes in a parent-child relationship. The parent note is identified by its ApptUNID item (which is its note universal ID), and the child note is identified by the same ApptUNID as the parent and the original RepeatInstanceDates. The ApptUNID and RepeatInstanceDates items form a key pair of values that uniquely identify a particular repeat instance. More details are covered in the Repeat Model section of this paper.

    So what you basically have to do is find the child Document of the event ($CSFlags conatins "i" and $Ref the parents UNID) and create a new (second) child document for the changed date/time, removing this particular date/time entry from the existing child document, IIRC. In such cases, I always do that manually in the Notes Client and then compare the fields created that way with the ones I created via my code.