3

I need to programmatically add events to a SharePoint Calendar and make them repeatable using JavaScript Client Object Model (without any c# code). Does anybody have ideas how can I implement this using ClientContext js class? Thx.

0

2 Answers 2

1
    var context = new SP.ClientContext.get_current();
    var list = context.get_web().get_lists().getByTitle("Calendar");
    var newEventCreateInfo = new SP.ListItemCreationInformation();
    var newEvent = list.addItem(newEventCreateInfo);
    newEvent.set_item("Location", "Office");
    newEvent.set_item("Start Time", "Start Time of JS Date() type");
    newEvent.set_item("End Time","End Time of JS Date() type");
    newEvent.set_item("Description","Discussion about Calendar JSCOM");
    newEvent.set_item("Title","New Discussion");
    newEvent.set_item("fAllDayEvent",false);
    newEvent.set_item("Category","Discussion");
    newEvent.update();
    context.executeQueryAsync(function(){ alert("Success");},function(){ alert("Failure");})
0

Please see the article for details how to add item to sharepoint list using js Client Object Model - http://www.avanadeblog.com/sharepointasg/2011/05/client-object-model-introduction-part-2-adding-a-list-item.html

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.