0

I am doing an event receiver which updates a list from another Site, I don't know how to access another site using CSOM

0

Grant your add-in with tenant Read permission and depoy the add-in as a tenant scoped add-in.

Then use cross domain library to access other site collection.

var ctx = new SP.ClientContext(appWebUrl);
var appContextSite = new SP.AppContextSite(ctx, targetUrl);
ctx.Load(appContextSite.get_web());

https://blogs.msdn.microsoft.com/officeapps/2012/11/29/solving-cross-domain-problems-in-apps-for-sharepoint/

  • I think this snippet does not work with Sharepoint Online – Joshua Dominic Sibug Sep 13 '18 at 5:21

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.