【发布时间】:2015-12-31 13:42:01
【问题描述】:
我有一个包含两个步骤的动态 CRM 插件。一个是在创建前运行,第二个是在创建后运行。我使用了共享变量。我在预创建时设置共享变量中的值并在创建后检索值。
现在它是线程安全的。如果两个用户在同一个组织中触发同一个插件,他们不会覆盖彼此的数据吗?
在共享变量中设置值:
context.SharedVariables.Add("statecode", stateCodeValue);
context.SharedVariables.Add("statuscode", statusCodeValue);
从共享变量中获取值:
int statecode = (int)context.SharedVariables["statecode"];
int statuscode = (int)context.SharedVariables["statuscode"];
【问题讨论】:
标签: c# multithreading plugins dynamics-crm