locked
How to send an email to CRM contact email when any document is uploaded in SharePoint 2010 RRS feed

  • Question

  • Hi Guys,

    How to send an email to CRM contact emailaddress1  when any document is uploaded in SharePoint 2010 using CRM 2011

    Please help me.

    Wednesday, October 19, 2011 11:16 AM

All replies

  • It can be done - but is quite hard work, and best avoided unless you have a good knowledge of SharePoint Development alongside CRM.  However can think of three technical designs you might use to achieve this:

    (1) You can look into SharePoint workflow to fire a action in SharePoint whenever a document is uploaded.  This action then determines which Document Library/Folder the document is been uploaded to, and determines the Contact or Account in CRM that this relates to.  From there the SharePoint workflow finishes by either sending a email to the Contact's Emailaddress1 field in CRM or by starting a CRM-based Workflow which then sends the email.

    Have done this before, but you do have to go into alot of SharePoint development alongside a working knowledge of CRM development which is best avoided if you can.

    (2) You could also integrate the 'emailaddress1' field into SharePoint as a field on the Folder that is storing the documents for a Account or Contact to limit the development to purely SharePoint dev to send the email out each time a Document is uploaded to the Folder or Document Library - but still is quite a bit of SharePoint dev.

    (3) Alternatively you could develop a regular process (via a Windows Service or Scribe maybe) that polls SharePoint to determine which documents have been uploaded between a certain Start Time and Finish Time.  For each document found, the service could then compare the folder location with CRM to determine which CRM Contact or Account the document is related to - and then send the email or start CRM Workflow to send the email.

    This method might be simpler to avoid getting your hands dirty developing custom SharePoint Workflow Actions.

    Best bet to get you started would be to examine how CRM stores it's links to SharePoint via the SharePointSite and SharePointDocumentLocation entities in CRM, and also google for 'SharePoint Client Object Model' and 'SharePoint Custom Workflow Actions' - this should give you a bit of background on how to begin developing this.

    Would also be worth logging a post on the SharePoint forums as some of the more SharePoint minded experts might have some suggestions on how best to do this. (as essentially the integration with CRM here is limited to the fact that the 'emailaddress1' field is stored outside of SharePoint, and SharePoint simply needs to email this address each time a document is uploaded)

    Hope some of that helps, SharePoint Development can be a bit of tricky beast at times..


    Kind Regards, Paul | http://crmconsultancy.wordpress.com
    Wednesday, October 19, 2011 11:56 AM
  • thanks for the reply.

    It will be helpfull if you can provide the sample links for the above scenarios.(sharepoint Workflow)

    Friday, October 21, 2011 7:42 AM
  • Last time I looked into this was for SharePoint 2007, but does not look like the framework has changed too much for 2010 - think the following three links should be useful:

    Develop Custom Workflow Activity for SharePoint 2010 Workflow, http://msmvps.com/blogs/sundar_narasiman/archive/2010/12/26/develop-custom-workflow-activity-for-sharepoint-2010-workflow.aspx

    SPD 2010 Custom Workflow Activity, http://blog.symprogress.com/2011/01/spd-2010-custom-workflow-activity/

    Creating custom WorkFlow Activities for SharePoint 2010, http://blog.voltje.be/?p=144

    There are some similarities in developing Custom Workflow Activities for SharePoint and Dynamics CRM as both use the Windows Workflow Foundation as their base.

    The SharePoint Client Object Model is also worth looking into, Microsoft give a good overview of this here:

    http://msdn.microsoft.com/en-us/library/ee857094.aspx


    Kind Regards, Paul | http://crmconsultancy.wordpress.com
    Friday, October 21, 2011 9:02 AM
  • Depending on how much information you need before you send the e-mail, you should have a look at sending e-mails using SharePoint Designer 2010. There is a "Send E-mail" action already available in SPD: http://office.microsoft.com/en-us/sharepoint-designer-help/introduction-to-designing-and-customizing-workflows-HA101859249.aspx

     

    Saturday, October 22, 2011 2:44 PM