diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 3f40942c..9b839067 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2263,6 +2263,7 @@ namespace VEPROMS.CSLA.Library if (sc.MyEnhancedDocuments != null && sc.MyEnhancedDocuments.Count == 1 && sc.MyEnhancedDocuments[0].Type == 0) { SectionInfo siSource = SectionInfo.Get(sc.MyEnhancedDocuments[0].ItemID); + if (siSource == null) return true; //B2018-142 null check to allow deletion of unlinked background procedure SectionConfig scs = siSource.MyConfig as SectionConfig; if (scs.Section_LnkEnh == "T") return true; } @@ -3886,6 +3887,8 @@ namespace VEPROMS.CSLA.Library { string tb = (LinkedOrdinal==null)? "NA" : LinkedOrdinal.ToString(); tbformat = tbformat.Replace("{LNK C/N Num}", tb); + if ((ActiveParent as ItemInfo).FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}")) + tbformat = tbformat.Replace("{Section Prefix}",""); // B2018-141 remove duplicate section number if ((ActiveParent as ItemInfo).LinkedTab != null) tbformat = tbformat.Replace("{LNK Step Num}", (ActiveParent as ItemInfo).LinkedTab.Trim(" .".ToCharArray())); //(ActiveParent as ItemInfo).Ordinal.ToString()); tbformat = tbformat.TrimStart(" ".ToCharArray()); @@ -7039,6 +7042,7 @@ namespace VEPROMS.CSLA.Library // now get its enhtype from the source: int enhtype = -1; ItemInfo sourceProc = ItemInfo.Get(eds[0].ItemID); + if (sourceProc == null) return null; //B2018-142 to allow an un-linked background procedure to be deleted EnhancedDocuments sourceProcEds = sourceProc.GetMyEnhancedDocuments(); foreach (EnhancedDocument spe in sourceProcEds) {