I have a Dynamic CRM plugin which has two steps. One is running on pre-create and second is running on post-create. I have used Shared Variables. I am setting the values in shared variables on pre-create and retriving the values on post-create.
Now is it thread safe. If two users trigger the same plugin in same org would not they over write each others data?
Set values in Shared Variables:
context.SharedVariables.Add("statecode", stateCodeValue);
context.SharedVariables.Add("statuscode", statusCodeValue);Get values from Shared Variables:
int statecode = (int)context.SharedVariables["statecode"];
int statuscode = (int)context.SharedVariables["statuscode"];