1

I created an API(In MVC) that fetch data from SharePoint calendar List using Client Context object. It worked but not able to read recurrence Events.

So that I use SPSite then how to pass credential to access sharepoint site in MVC solution using server side object model.

  • 1
    It would be good if you share your code. Also if you are creating MVC solution to be used from remote machine, then server object model cannot be used. – Asad Refai Jun 9 '17 at 12:58
2

You cannot use the SPSite object in the remote application.

If you want to read calendar recurrence data you can follow below steps

oListItem["fRecurrence"] is a boolean variable to know calendar event is a "Recurrence" event.

oListItem["RecurrenceData"] field to get the recurrence data in XML format. You can parse and get into C# object.

  • Then without SPSite object how to read all Events... – Sarika Koli Jun 12 '17 at 4:17
  • You should use SharePoint Client SDK. If you are new to the CSOM read this article dev.office.com/blogs/… – Venkat Konjeti Jun 12 '17 at 15:04
  • I use CSOM but it not return all Events.... – Sarika Koli Jun 13 '17 at 4:20
  • Did you use any CAML query? – Venkat Konjeti Jun 13 '17 at 4:23
  • yes, CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = "<View><Query><Where>" + "<DateRangesOverlap><FieldRef Name=\"EventDate\" />" + "<FieldRef Name=\"EndDate\" />" + "<FieldRef Name=\"RecurrenceID\"/>" + "<Value Type=\"DateTime\"><Month /></Value></DateRangesOverlap>" + "</Where></Query></View>"; – Sarika Koli Jun 13 '17 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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