Search code examples
sharepointlocationdocumentdynamics-crm-2013

CRM 2013 on premise: Create sharepoint document location only when user selects on documents button at the record


At present my plugin creates SharePoint location when Accounts record created, But I want to avoid unnecessary SharePoint location created i.e. site/folder, so only when user clicks on Documents menu (or may be some custom button) the SharePoint location should be created.

Can I do this? if yes, how?


With Custom button now I am able to create SharePoint locations. But now requirement is to create it on the navigation item "Documents". I am not able to bind the Click event of the Documents navigation item. if I try with

document.getelementbyid(item.getId()).onclick = function () {
    calljsfunction()
    }

I get error of

There was an error with this field's customized event
Field:window
Event:onload
Error:undefined

Solution

  • 2 steps:

    1.Write CustomAction that creates the DocumentLocation 2.Call it from javascript,which executed by CustomCommand in the ribbon

    See this post for further information: https://deepakexploring.wordpress.com/2013/10/23/actions-in-crm-2013/

    If you need more explanations add comment..