diff --git a/Design/Rule0035ExplicitSetAllowInCustomizations.cs b/Design/Rule0035ExplicitSetAllowInCustomizations.cs index 7beabc37..1767a4b9 100644 --- a/Design/Rule0035ExplicitSetAllowInCustomizations.cs +++ b/Design/Rule0035ExplicitSetAllowInCustomizations.cs @@ -28,7 +28,9 @@ private void AnalyzeAllowInCustomization(SymbolAnalysisContext ctx) if (manifest.Runtime < RuntimeVersion.Fall2023) return; ICollection tableFields = GetTableFields(ctx.Symbol).Where(x => x.Id > 0 && x.Id < 2000000000) + .Where(x => x.GetBooleanPropertyValue(PropertyKind.Enabled) != false) .Where(x => x.GetProperty(PropertyKind.AllowInCustomizations) is null) + .Where(x => x.GetProperty(PropertyKind.ObsoleteState) is null) .ToList(); if (!tableFields.Any()) return; @@ -46,7 +48,7 @@ private static ICollection GetTableFields(ISymbol symbol) { switch (symbol.GetContainingObjectTypeSymbol().GetNavTypeKindSafe()) { - case NavTypeKind.Table: + case NavTypeKind.Record: return ((ITableTypeSymbol)symbol).Fields; case NavTypeKind.TableExtension: return ((ITableExtensionTypeSymbol)symbol).AddedFields; @@ -60,7 +62,7 @@ private static ICollection GetPageFields(NavTypeKind navTypeKind, ICollection pageFields = new Collection(); switch (navTypeKind) { - case NavTypeKind.Table: + case NavTypeKind.Record: foreach (IPageTypeSymbol page in relatedPages.Cast()) { IEnumerable fields = page.FlattenedControls.Where(x => x.ControlKind == ControlKind.Field && x.RelatedFieldSymbol != null) @@ -87,7 +89,7 @@ private static IEnumerable GetRelatedPages(SymbolA { switch (ctx.Symbol.GetContainingObjectTypeSymbol().GetNavTypeKindSafe()) { - case NavTypeKind.Table: + case NavTypeKind.Record: return ctx.Compilation.GetDeclaredApplicationObjectSymbols() .Where(x => x.GetNavTypeKindSafe() == NavTypeKind.Page) .Where(x => ((IPageTypeSymbol)x.GetTypeSymbol()).PageType != PageTypeKind.API)