locked
Create sub-site in SharePoint on create of account entity record in CRM Online Organization without using "Microsoft.SharePoint.Client" DLL RRS feed

  • Question

  • Hi,

    I want to create a sub-site in SharePoint Online on create of account entity record in my CRM Online organization.

    I don't want to use"Microsoft.SharePoint.Client"as the use of this DLL requires installation of SharePoint Client Components on the client server. As my CRM environment is Online, I cannot use this DLL. So, I am trying to use REST APIs to implement the functionality.
    Does anyone know how to achieve this?

    Thursday, April 2, 2015 11:31 AM

Answers

All replies

  • Hello,

    It's true you can't use the dll's as they are not available on the CRM server in the cloud. I did some research and will try to give you a headstart. I never did customizations on an online environment, so if someone has a better solution, I would be happy to read.

    I would create a plugin on the creation of an account and call the REST API via C# in the plugin.

    The following article describes how to integrate CRM Online to SharePoint Online using REST & ADFS (authentication isn't limited to ADFS 'You can authenticate using corporate credentials if inside your network, username/password if outside your network (e.g CRM Online O365) and you can also use your onmicrosoft.com accounts'). If a GET request is possible, a POST should be possible too (to create your folder) :), use the Files & Folders REST API Reference  .

    Hope it helps,

    Kind Regards

    Thursday, April 2, 2015 1:18 PM
  • Hi Purva,

    The SharePoint REST API is documented here - https://msdn.microsoft.com/en-us/library/fp142380.aspx.

    Also note, the Out of the box SharePoint integration will do this for you but you do not have as much control of the SharePoint folder structure.  https://msdn.microsoft.com/en-us/library/gg334768.aspx

    Hope this Helps,

    --Scott

    Thursday, April 2, 2015 1:23 PM
  • Thanks for your reply Jochen. I have tried the same thing. This works fine for "GET" method, but produces the following error for "POST" method.

    - The remote server returned an error: (403) Forbidden.


    • Edited by P H S Thursday, April 2, 2015 2:32 PM
    Thursday, April 2, 2015 2:21 PM
  • Thanks for your information Scott. But, I am trying to create a sub-site in SharePoint though code (on create of account entity record in CRM Online Org). As mentioned in the first link. I need to create URL enpoint for the same. Any idea how to solve this?

    • Edited by P H S Thursday, April 2, 2015 2:33 PM
    Thursday, April 2, 2015 2:30 PM
  • Purva,

    As you can read here https://msdn.microsoft.com/en-us/library/office/jj164022.aspx#WritingData when creating, updating, and deleting SharePoint entities is that if you aren’t using OAuth to authorize your requests, these operations require the server’s request form digest value as the value of the X-RequestDigest header.

    More info about the X-RequestDigest: Tip handling http 403 forbidden when querying the search rest service using the Postquery Method

    Hope it helps

    • Marked as answer by P H S Friday, April 3, 2015 8:43 AM
    Thursday, April 2, 2015 2:32 PM
  • Sorry, the original link i posted was to SDK code and not the Out of the Box SharePoint integration configuration located here - https://technet.microsoft.com/en-us/library/jj863709.aspx

    The above config steps will automatically create a sharepoint site on create of account.  Are you looking for something different?

    --Scott

    Thursday, April 2, 2015 2:33 PM
  • Hi, I have found the following useful link-

    - http://journeyintocrm.com/archives/280

    It works fine.

    • Marked as answer by P H S Friday, April 3, 2015 8:43 AM
    Friday, April 3, 2015 8:43 AM