diff --git a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs
index 52cd752720..d149e2882e 100644
--- a/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs
+++ b/src/libraries/Microsoft.PowerFx.Core/App/IExternalEnabledFeatures.cs
@@ -21,7 +21,9 @@ internal interface IExternalEnabledFeatures
bool IsEnhancedComponentFunctionPropertyEnabled { get; }
- bool IsComponentFunctionPropertyDataflowEnabled { get; }
+ bool IsComponentFunctionPropertyDataflowEnabled { get; }
+
+ bool IsRemoveAllDelegationEnabled { get; }
}
internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures
@@ -36,6 +38,8 @@ internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures
public bool IsEnhancedComponentFunctionPropertyEnabled => true;
- public bool IsComponentFunctionPropertyDataflowEnabled => true;
+ public bool IsComponentFunctionPropertyDataflowEnabled => true;
+
+ public bool IsRemoveAllDelegationEnabled => true;
}
}
diff --git a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs
index 8a4a109439..abf908f462 100644
--- a/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs
+++ b/src/libraries/Microsoft.PowerFx.Core/Public/Config/Features.cs
@@ -82,11 +82,6 @@ public sealed class Features
///
internal bool IsUserDefinedTypesEnabled { get; init; } = false;
- ///
- /// Enables Remove All delegation.
- ///
- internal bool IsRemoveAllDelegationEnabled { get; set; }
-
internal static readonly Features None = new Features();
///
diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs
index f8e57f83cf..e4cc808eec 100644
--- a/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs
+++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs
@@ -509,12 +509,9 @@ public override bool IsServerDelegatable(CallNode callNode, TexlBinding binding)
}
// Use ECS flag as a guard.
- if (binding.Document != null)
+ if (binding.Document != null && !binding.Document.Properties.EnabledFeatures.IsRemoveAllDelegationEnabled)
{
- if (!binding.Features.IsRemoveAllDelegationEnabled)
- {
- return false;
- }
+ return false;
}
if (!binding.TryGetDataSourceInfo(callNode.Args.Children[0], out IExternalDataSource dataSource))