我正在使用SDK为CRM 2011编写一个插件。这个插件是作为一个操作后插件同步执行的.插件将触发一个步骤,该步骤应该检索两个属性,并根据发现的内容执行一些逻辑。然而,不幸的是,所讨论的属性不在目标的属性集合中。(它们不是用户正在更新的字段)。我需要能够读取这些属性,即使它们没有被积极地更新。这是我的密码:
Dim context As IPluginExecutionContext = CType(serviceProvider.GetService(GetType(IPluginExecutionContext)), IPluginExecutionContext)
If context.InputParameters.Contains("Target") AndAlso TypeOf context.InputParameters("Target") Is Entity Then
Dim entity As Entity = CType(context.InputParameters("Target"), Entity)
If entity.LogicalName.Equals("contact") Then
Try
Dim attribute1 As Object = entity.Attributes("abc") ' not in Attributes collection
Dim attribute2 As Object = entity.Attributes("def") ' not in Attributes collection
Catch ex as Exception
...所以我的问题是,从插件中检索实体属性的最佳方法是什么?我是否需要使用OrginizationService向客户关系管理发出单独的查询,还是有办法从上下文中获取它?
谢谢!
发布于 2013-07-24 15:07:49
两种方法。
前后实体图像
https://stackoverflow.com/questions/17837229
复制相似问题