0

I am using this wonderful snippet by Ulrich Krause for creating a calendar entry using XPages. The snippet works as defined, however, we were looking for a solution to also add required attendees using the same code and hence we added this small snippet to the code to do the same:

Added this snippet to the mentioned Ulrich Krause Code
/**
* @description
* sets the required users for the calendar
*/
this.setMembers =  function (members:java.util.Vector) {
this._members = members;
}

// And further we set the RequiredAttendees field as shown below
var item:NotesItem = null;
item = doc.replaceItemValue('RequiredAttendees', this._members);
item.setNames(true);
//Also tried setting field "EnterSendTo" as mentioned in few solution with no success

All the fields are set correctly (we verified this by checking the document properties view), however, as soon as we open the calendar entry the RequiredAttendees field just disappears as if it was not there. It seems like some calendar specific function just run after the entry is open and tries to recalculate the value based on something we are not clearly aware of.

Any help in this direction would be really be helpful.

1 Answer 1

2

The problem is, that simply setting the item "RequiredAttendees" does not do anything.

Calendaring and scheduling is a complex task, and there is a document called Calendaring and Scheduling Schema that describes all necessary documents / fields / workflow- steps

In the client the RequiredAttendees- field will be replaced with the contents of the EnterSendTo- field.

Setting EnterSendTo in your code as well MIGHT prohibit the deletion of your RequiredAttendees- field, but you will still not have any invitation sent to your attendees.

You need to follow the complete workflow to really create a document with invitation to all required attendees and get their responses.

  • there has to be a "main" calendar entry with an ApptUnid- field to identify it
  • this document has to have all required fields set
  • there has to be at least one document of type "notice" that is a response to the main calendar entry and has the ApptUnid field set to the one of the main entry.
  • you have to send the notice as mail to the required attendees
  • they have to answer the invitation ...

Best advice could be to do this complete job in a backend- class or scriptlibrary and just trigger it via Javascript.

If you have Domino 9, then probably you could use the Domino Calendar REST Service to achieve your goal.

Sign up to request clarification or add additional context in comments.

3 Comments

Um, thanks a lot, that's kind of precisely what I was looking for. It now becomes clear why when reserving the room it worked correctly (since a document of type notice was created). However, just a small question, I don't intend to send an invitation mail using the calendar schema (I have my own mailing strategy behind it), what I just want to do is to add the required users to the calendar entry, is there a way around to that? (EnterSendTo doesn't help as well, still the required field remains empty)
Just checked and could not find the code that resets "RequiredAttendees". has to be in some of the script- libraries though...
I will look into it and update the same if possible. Thanks a lot again for a well explained answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.