none
Create Project Calendar Programatically using CSOM RRS feed

  • Question

  • Hi all

    Having an issue(which seems to be simple) while trying to create a calendar using CSOM, though i can see in SDK there is definition of properties and methods for CalendarCreationInformation but when i try to create a calendar using CSOM it throws error no matter what, i have tried everything possible way, seems i am definitely missing something here, would appreciate any help, below is the basic code i am using 

     CalendarCreationInformation newCal = new CalendarCreationInformation();
                                //Guid CalID = cal.Id;
                                newCal.Id = Guid.NewGuid();//CalID;
                                newCal.Name = cal.Name;
                                try
                                {
                                    ProjContextHelper.Calendars.Add(newCal);
                                    ProjContextHelper.Calendars.Update();
                                    ProjContextHelper.ExecuteQuery();
                                }
                                catch (Exception ex)
                                {
                                    MessageBox.Show(ex.Message);
                                }

    Error:

    


    Monday, January 15, 2018 9:00 PM

All replies

  • Check this article where i have published the code to create CSOM

    https://social.technet.microsoft.com/Forums/projectserver/en-US/e0aeb8bf-4c46-46e3-b4a2-14f2f6cc7d56/csom-create-new-calendar?forum=projectonline#362681e1-5a00-43ce-b2e8-fa1d36250cc8

    Monday, May 21, 2018 3:11 PM