2011-01-05 40 views
0

如何更新en实体,例如:updateEntity [“name”] =“:”...我不明白我应该如何使用图像(前/后)和“新步骤”前/后。请给我一些指导我如何更新实体。看起来似乎没有任何问题,最后一步......如何用某个值(字符串)更新一个实体。谢谢... Fred 下面的代码有什么问题?CRM 4 entity [“name”] =“新值”;

// Obtain the target business entity from the input parmameters 
       DynamicEntity entity = (DynamicEntity)context.PreEntityImages["PreServiceMobile"];// context.InputParameters.Properties["Target"]; 
       DynamicEntity updateEntity = (DynamicEntity)context.InputParameters.Properties["Target"]; 

          updateEntity["name"] = "value"; 
+0

确保您在更新时也提供记录的ID。 SDK文档可能会有所帮助。 http://msdn.microsoft.com/en-us/library/cc151102.aspx – 2011-01-05 20:34:39

回答

2

您只能在预置阶段插件期间在输入实体中设置值。在后期插件中,实体已被保存。如果您需要在后期更新实体,则需要调用CrmService.Update(实体)

相关问题