Search SharePoint for Stuff for a Dynamics CRM Record
| Question |
| I’ve heard you can search SharePoint from external applications. I want to search it from a Dynamics CRM account form, so I can see all of the documents stored in our MOSS site related to an Account record in CRM. Is this possible? |
| Answer |
| Excellent question. (Meaning, I think it’s interesting AND I can answer it.) Here’s what I did — you can of course modify this to meet your specific requirements. Probably most important is the url I’m searching in the example, which is our firm’s intranet site. If you’re searching a SharePoint site that you navigate to by typing ‘http://foo.acme.com‘, sub that in for the ‘http://wss.imginc.com‘ references you see below and this will work fine. 1. Add a tab to the Account form. I called mine ‘MOSS Search’. Add a section to it, and onto that section add an IFRAME. I called mine ‘moss_search’, so the full name of the IFRAME is IFRAME_moss_search.2. Add the following code to the onLoad event of the Account form:
// JScript source code var sLiveSearchURL = ”; if(IsOnline()) case CRM_FORM_TYPE_UPDATE: // Set the IFRAME’s URL
One more point about the code snippet above: the imgSearchURL variable will need to be replaced by whatever the url is for your SharePoint search results page. Just do a search with no parameters to see what it is and sub that in. This is a nice illustration of how you can integrate Dynamics CRM and SharePoint, but it also applies to other scenarios when you want to do what I call contextual searching from within Dynamics CRM. Let me know what you think! |



Integrating Dynamics CRM 4 and SharePoint 2007 Said,
June 22, 2009 @ 11:03 am
[...] Here’s an article specifically about how to implement SharePoint search from a Dynamics CRM account form. [...]
Heti Said,
July 7, 2009 @ 12:28 am
We are currently using MS CRM 4.0 and would like to integrate it with SharePoint. The requirement is that we use forms within CRM to create documents in SharePoint. E.g. the information captured in the Account form (Account Name, Address ect)is filled into a proposal template which is then saved in SharePoint. We will also want to be able to search for the SharePoint document from within CRM. Is that possible and do you have any advise on where we can begin? we haven’t started with any integration yet.
Richard Knudson Said,
July 10, 2009 @ 2:53 pm
Hi Heti – sorry it took me so long to reply! Good questions. Both are quite possible. The second (searching for SharePoint content based on the CRM record is quite easy, depending on the specifics. You could try the code from the article — let me know if you have questions about it. The first (creating SharePoint sites or doc libs automatically and putting things into them based on the CRM record) is do-able but would take a little more work, in the form of (most likely) some web services code to program SharePoint. If you want to give me specifics I can help you determine how much work it might take. feel free to email directly at richardk@imginc.com if you prefer.
Regards,