When you run through the wizard of Document Management settings, you check the entities which you want to enable documents on, and you enter the url to the SharePoint site collection:
When I do this, everything works fine. A SharePoint site is added in the SharePointSite entity in CRM. However I want to accomplish the same with coding. So I deleted the SharePoint site in CRM and tried to recreate it programmatically.
However I don't seem to get this to work. Either I get an error that there are no active site when I only create the site in CRM. Or I get other errors, e.g. Invalid User Authorization:
That error is for the exact same site I create programmatically just after I deleted that exact site created with the wizard.
I've been through the documentation:https://msdn.microsoft.com/en-us/library/gg327818.aspx and I can't seem to find anywhere that what I'm trying to do is unsupported.
Am I missing something? I assume that creating a site record in CRM is not enough and it needs to be validated. Can I do this programmatically as wel?
What I'm trying to do is to create a document site for every account in CRM. As there will be over 20.000 accounts and growing fast, I don't want to use the default integration and I don't want to manually create every Site Colllection in CRM as SharePoint site.
Btw, I'm using CRM online and SharePoint online.
*This post is locked for comments