public static void EnsureFieldHTML(this FieldCollection flds, string cFieldType, string cInternalName, string cFieldTitle, string cFieldDescription, string cGroup) { try { if (!flds.HasField(cFieldTitle, cInternalName)) { flds.AddFieldHTML(cInternalName, cFieldTitle, cFieldDescription, cGroup); } else { Field fld = flds.GetField(cInternalName); if (fld.TypeAsString != cFieldType) { System.Diagnostics.Trace.WriteLine("Alert"); } } } catch (Exception ex) { throw new Exception(string.Format("Error in extFieldCollection.EnsureField - {0} - {1}", cFieldTitle, ex.Message), ex); } }