I had created some common assembly with helper methods and called it "Helper". Then I had created a static class with static variable and had put the value into it, at the first plugin execution runtime. In the second plugin I just get the value from the static common variable.
And nothing about read\write DB operations.
Helper assembly.
namespace Helper { public static class Keeper { private static bool _UpdateOppAfterHistory = true; public static bool UpdateOppAfterHistory { get { return _UpdateOppAfterHistory; } set { _UpdateOppAfterHistory = value; } } } public class OpportunityHelper { ... } }
First firing plugin code
Keeper.UpdateOppAfterHistory = false; OpportunityHelper.CreateOpportunityHistory(Opp,crmService); // removing the flag to the back Keeper.UpdateOppAfterHistory = true;
Second firing plugin code
// common shared variable analysis bool UpdateOppAfterHistory = Keeper.UpdateOppAfterHistory; if (UpdateOppAfterHistory) { ... }