简体   繁体   English

从CRM 2011中提取SQL Server价值-如何做到这一点?

[英]Extracting SQL Server Value from CRM 2011 - How do I do this?

Ok so in CRM 2011 I have a field called Contract Expiry Date and I want to populate this value from an external SQL Server database...Basically I just need to grab this value, nothing fancy but where do I start? 好的,因此在CRM 2011中,我有一个名为“合同到期日期”的字段,我想从外部SQL Server数据库中填充此值...基本上,我只需要获取此值,别无所求,但是我从哪里开始?

I am familiar with JavaScript and how to use it in CRM 2011, however, for connecting to a Database it is not recommended to use JavaScript. 我熟悉JavaScript以及如何在CRM 2011中使用它,但是,建议不要使用JavaScript来连接数据库。 Where do I start with something like this? 我该从哪里开始呢? I would like to run this query on the load of the form in CRM. 我想在CRM中表单的负载上运行此查询。 Any ideas, do I start with .Net? 有什么想法,我应该从.Net开始吗?

Thanks for the help! 谢谢您的帮助! Tudor 都铎王朝

It depends what you want, i think you have two options: plugin or a batch process. 这取决于您想要什么,我认为您有两种选择:插件或批处理。

A plugin reacts to a event (create, update, delete, ...) of an entity. 插件对实体的事件(创建,更新,删除等)作出反应。 If you want do this in any of this event this is the best solution for you. 如果您想在任何此事件中执行此操作,这是最适合您的解决方案。 In plugin you just need connect to a external database and affect some field of an entity (you have to persist the value in one entity). 在插件中,您只需要连接到外部数据库并影响实体的某个字段(您必须将值保留在一个实体中)。

If you don't have any event to put that code you can do a command line application (batch), you can put as schedule task, that do the same behavior of plugin (connects to external database and affect one entity in crm). 如果没有任何事件可放入该代码,则可以执行命令行应用程序(批处理),可以将其作为调度任务放入,该任务执行与插件相同的行为(连接到外部数据库并影响crm中的一个实体)。 See here a example of a plugin. 请参阅此处的插件示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM