Integration between CRM 2011 and External DB
-
2012년 4월 12일 목요일 오전 11:45
Hi all,
In my project I am integrating with CRM 2011(On premises) with one external database. I have one ID field in CRM form which represent the external db, also depend on that particular ID field some others field will populate data from that external db.
For database connection, i have created a connector(using .net) which will return data from external db.
eg: Account name XYZ have the reference number like 123. now if I call a method to fetch account name from external db by reference number[like: method1(123) ] it will return company name [like: XYZ].
Now I want to run this method for page_load event of CRM account form, thus when a particular account record will open, the system will call the method from dll to fetch the details related to that particular ID(Accout record which I just opened).
I have the DLL ready, but my concern is that how will I force CRM to call the methods of that DLL in the form_load event of account form?
모든 응답
-
2012년 4월 12일 목요일 오전 11:56중재자You will need to write a web service that use this dll, then write javascript code to call the web service
My blog : http://mscrmtools.blogspot.com
Did you try the new CrmDiagTool for Microsoft Dynamics CRM 2011 ? If not, follow me
Upgraded tools for Dynamics CRM 2011!
View Layout Replicator | Searchable Property Updater | Ribbon Browser | SiteMap Editor | JavaScript Web Resource Manager | Role updater -
2012년 4월 12일 목요일 오후 12:02
Thanks Tanguy T,
can you / anyone please elaborate the steps (codes for web service and JScript), as I am very new in CRM development with custom code.
Regards,
aanch
Regards, aanch
-
2012년 4월 12일 목요일 오후 1:09중재자
Hi,
you can write a Custom Webservice where you can create connection string for your custom database and call this webservice using javascript on form load.
if you are using MS CRM 4.0 refer http://mahenderpal.wordpress.com/2009/12/31/calling-external-webservice-using-js/
if you are using MS CRM 2011 refer http://mahenderpal.wordpress.com/2011/08/24/calling-external-webservice-from-ms-crm-2011-asynchronously-javascript/
Mahain : Check My Blog
Follow me on Twitter
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question. -
2012년 4월 12일 목요일 오후 5:42
You could also use a CRM plugin to fire on the 'retrieve/multiple' of your entity that populates the custom fields from your external data source. However you'd have to re-implement your connector inside the plugin or use something like ILMERGE to package your connector with the plugin. Technically since you are on-premise you could put your connector assembly in the GAC and reference it from a non-sandbox plugin as well.
I usually prefer to do this kind of thing in plugins if possible, but sometimes the javascript invocation is the only feasible way.
-
2012년 4월 17일 화요일 오전 4:46
Hi Ken,
I am using CRM online trial version for testing purpose. Instead of using the DLL, I have used the class(which basically connecting with DB and return the information) in my plugin project. I have used sample plugin project from CRM 2011 Training kit. The plugin project is running successfully without attaching the class. In another sample project(not a plugin project, a sample .net project) I have tested only the class and I got desired result in so the class is fine. But when I am attaching the class with the plugin project and register the final DLL to my CRM online project SQL server error is happening. Below is the screen shot of the error.
may be when we using SQL server connection with CRM the plugin project needs some added feature. can you point out those if it is true?
Thanks in advance.
Regards, aanch
-
2012년 4월 17일 화요일 오전 8:12
Hi,
A simplier approach may be to use an embedded iFrame to display the data from your external database.
You can pass the Id ifield as a parameter to a web page
some details here
http://msdn.microsoft.com/en-us/library/gg328034.aspx
http://blogs.msdn.com/b/crm/archive/2009/04/15/microsoft-dynamics-crm-iframe-magic.aspx
hth
Joe
-
2012년 4월 17일 화요일 오전 8:59중재자Crm Online will not allow you to use a direct SQL connection within a plugin (this is due to the code access security implemented by the Crm Sandbox). However, if you will implement CRM OnPremise, then you will be able to make the SQL connection
Microsoft CRM MVP - http://mscrmuk.blogspot.com http://www.excitation.co.uk
- 편집됨 DavidJennawayMVP, Moderator 2012년 4월 17일 화요일 오전 9:00
-
2012년 4월 17일 화요일 오전 11:05
Use a plugin instead of the javascript option. That way you'll be sure that the data is retrieved for a record even if the form isn't opened by the user.
Otherwise, you would risk that data imported with the import tool or future data integrations would not receive the necessary data from the external db
-
2012년 4월 18일 수요일 오전 5:52
Hi David,
I have used On premises instead of CRM online, but the same SQL error is showing.
Regards, aanch
-
2012년 4월 18일 수요일 오전 6:02중재자
Can you please provide source code of your class and plugin?
Other thing is in case you have possibility to test your plugin on On-Premice you can debug your plugin using VS.
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
-
2012년 4월 27일 금요일 오전 7:14
Hi Everyone,
Good News :) The problem is solved.
Actually I have used the IP address of the SQL Server. As per the rules of CRM
" IP addresses cannot be used. You must use a named Web address that requires DNS name resolution.”
As I have called the external system by IP address, so the problem is there.
Thanks to everyone.
--------------------------------------------------------------------------------
If you find this post helpful then please "Vote as Helpful".
Regards, aanch
- 답변으로 표시됨 aanch 2012년 4월 27일 금요일 오전 7:14