diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 7b9a50b0..e015ae25 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -925,6 +925,21 @@ namespace VEPROMS.CSLA.Library scng = sc.ToString(); } tmp = NewItemInfoFetch(ItemID, addType, number, text, type, null, null, scng, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); + // B2017-083: first child - adjust the docversion itemid to point to this new one: + if (IsProcedure && tmp != null && tmp.MyPrevious == null) + { + if (this.MyDocVersion != null) + { + using (DocVersion parentItemDV = MyDocVersion.Get()) + { + using (Item tmpi = tmp.Get()) + { + parentItemDV.MyItem = tmpi; + parentItemDV.Save(); + } + } + } + } } if (tmp == null) return null; // if next exists, it is updated in SQL so we have to manually force the iteminfo updates