Archive for August 2007
新的CRM 3.0 VPC
八月, 微软推出了新的 CRM VPC.你可以到以下连接下载。
Callout.config.xml 文件
你写完CRM的Callout,应该怎样把它跟CRM连接起来呢? 如果你想把CRM跟你写的程序连接起来, 你就需要在callout.config.xml的文件上加连接。 callout.config.xml的文件一般在 C:Program FilesMicrosoft CRMServerbinassembly文件夹里。
Callout.config.xml 可以在CRM 3.0SDK里找到。但那个例子有很多不需要的东西。如果你想要一个干净callout.config.xml 的模板, 就用以下的吧。只要把以下的放到notepad, 然后把它save成 callout.config.xml 放到assembly文件夹里, 就可以了。
<callout.config version="1.0" xmlns=" http://schemas.microsoft.com/crm/2006/callout/"> <!--在这里加连接--> </callout.config>
我给一个例子,如果想跟 Account 连接, 在CRM Account Save后, 开动你的程序。你的callout.config.xml例子是以下:
<callout.config version="1.0" xmlns=" http://schemas.microsoft.com/crm/2006/callout/"> <callout entity="account" event="PostCreate"> <subscription assembly="CalloutSample2.dll" class="CalloutSample2.CalloutComponent" onerror="abort"> <postvalue>@all</postvalue> </subscription> </callout> </callout.config>
1. PostCreate就是record 创建完后, PostUpdate就是record更新后, PostDelete就是删除后。
2. CalloutSample2.dll就是那个class library的名。如果你写的dll名是hello.dll. 你可以把calloutsample.dll改为你dll的名。
3. calloutcomponent是class的名, 如果你的dll那里有class叫darren,那么就是hello.darren.
4. onerror="abort"意思是说,如果有错误,就停止。
5. <postvalue>@all</postvalue>, 就把所有字段的值都给你。
以下的例子就在把Account创建完后,更新后, 删除后, 跟你的程式连接上。
<callout.config version="1.0" xmlns=" http://schemas.microsoft.com/crm/2006/callout/"> <callout entity="account" event="PostCreate"> <subscription assembly="CalloutSample2.dll" class="CalloutSample2.CalloutComponent" onerror="abort"> <postvalue>@all</postvalue> </subscription> </callout> <callout entity="account" event="PostUpdate"> <subscription assembly="CalloutSample2.dll" class="CalloutSample2.CalloutComponent"> <postvalue>name</postvalue> </subscription> </callout> <callout entity="account" event="PostAssign"> <subscription assembly="CalloutSample2.dll" class="CalloutSample2.CalloutComponent" onerror="ignore"> <prevalue>name</prevalue> </subscription> </callout> <callout entity="account" event="PostDelete"> <subscription assembly="CalloutSample2.dll" class="CalloutSample2.CalloutComponent" onerror="ignore"/> </callout> </callout.config>
我的中文能力有限, 希望能给大家解释道callout.config.xml的文件, 如有什么问题, 请到论坛上问,我会尽能力帮助大家的。
这个星期我休假, 或者没有办法能立即解答你们的问题。
什么是CRM Callout?
Callout 是微软给我们提供增加CRM 3.0功能的方法之一。软件开发者可以编写自己的程式 (dll),然后通过订阅的方式,在CRM Save 纪录之前后, 让CRM执行你的代码。Callout有两种:Pre-Callout是在纪录Save之前执行, Post-Callout是在纪录Save后执行。 Pre-Callout一般用来做纪录Save之前的更改,我常勇PreCallout 来检查系统要将Save的纪录是不是已经在系统里等等。。。 Post-Callout 我通常用来做系统的集成。
以下是CRM的Callout大家可以订阅 (Subscribe):
Logical Event – Description
PreCreate – Generated before an entity instance is created.
PostCreate – Generated after an entity instance is created.
PreUpdate – Generated before an entity instance is updated.
PostUpdate – Generated after an entity instance is updated.
PreDelete – Generated before an entity instance is deleted.
PostDelete – Generated after an entity instance is deleted.
PreAssign – Generated before an entity instance is assigned to a new owner.
PostAssign – Generated after an entity instance is assigned to a new owner.
PreSetState – Generated before the state is changed for entity instance.
PostSetState – Generated after the state is changed for an entity instance.
PreMerge – Generated before merging two entity instances.
PostMerge – Generated after merging two entity instances.
PreSend – Generated before sending an e-mail.
PostDeliver – Generated after delivering an e-mail
Pre-Callout 模式
Post-Callout 模式
下一个Blog教大家来做一个Post-Callout.