// Now add the offset records hasBrokenRules = this.CreateOffsetRecord(tradeID1, profitID, quantity); if (hasBrokenRules) { this.oProfit.GetProfitByProfitID(profitID); this.oProfit.Delete(); return mmSaveDataResult.RulesBroken; } hasBrokenRules = this.CreateOffsetRecord(tradeID2, profitID, quantity); if (hasBrokenRules) { this.oProfit.GetProfitByProfitID(profitID); this.oProfit.Delete(); return mmSaveDataResult.RulesBroken; }If rules are broken, I am just deleting the profit record. Now, heres the problem. When I run createoffsetrecord the second time, the checkruleshook method in the Rules class for the offset object does not run because the RowChanged state is "Unchanged".
private bool CreateOffsetRecord(int tradeID, int profitID, int quantity) { OffsetDefaults OD = new OffsetDefaults(profitID, tradeID); this.oOffset.NewEntity(OD); this.oOffset.Entity.offsetqty = quantity; this.oOffset.SaveEntity(); return this.oOffset.Rules.HasBrokenRules; }The second record I am adding has a different tradeID, so my question is why is the RowState unchanged on the second add row operation? Am I missing some command here?