web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog

(0) ShareShare
ReportReport
Posted on by 11
Hi
I have tried without luck to disable this flight on my DEV box.
The code I'm trying to disable is the following
void executeQuery()
{
    if (DisableDefaultFilterForSysDataBaseLogFlight::instance().isEnabled())
    {
        utcdatetime currentDateTime;

        if (DisableRemoveTimeZoneOffsetFlight::instance().isEnabled())
        {
            currentDateTime = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone());
        }
        else
        {
            currentDateTime = DateTimeUtil::getSystemDateTime();
        }

        utcDateTime pastDateTime = DateTimeUtil::addDays(currentDateTime, -7);

        this.query().dataSourceTable(tableNum(SysDataBaseLog)).addRange(fieldNum(SysDataBaseLog, CreatedDateTime)).value(SysQuery::range(pastDateTime, currentDateTime));
        Microsoft.Dynamics.ApplicationPlatform.XppServices.Instrumentation.DataAccessEventSource::EventWriteDirectSqlTrace
            ("", "ExecuteQuery","Default Filter applied on createddatetime field to display only last one week of data on Form Load","Customer is allowed to modify the filter as required");
    }

    super();
}
This is adding a filter to the database log form when opened, set to past week, which we want to get rid of.
 
Any help or suggestions appreciated.
 
Regards,
Steinunn
 
Categories:
I have the same question (0)
  • Sohaib Cheema Profile Picture
    47,027 User Group Leader on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
     
    You are right. I was expecting it wrong, thinking KillSwitch would be available by default. As you mentioned, it is other way round. 
  • Anthony Blake Profile Picture
    2,579 Super User 2025 Season 2 on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    Hi @Sohaib Cheema, I expect you won't see the kill switch unless you explicitly insert it. Most SysFlighting entries need to be inserted to be used. Also restart the environment (or services in T2+) after inserting for the flighting to take effect.
  • Sohaib Cheema Profile Picture
    47,027 User Group Leader on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    Good find @steinunna that is something for me to look about KillSwitch. I would spend some further time on the DLL..
     
    Could you tell me your Dynamics version? I checked, trying finding the SYSFLIGHTING Table on version 10;0.45 preview and I cannot find the KillSwitch there 
     
     
  • steinunna Profile Picture
    11 on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    Follow up.
    I looked into using the kill switch and was able to turn the flight off in my DEV box.
     


    Will be contacting MS if we decide to turn it off in PROD.
     
  • Sohaib Cheema Profile Picture
    47,027 User Group Leader on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
     
    To be honest, I am not aware of the reason, as to why. I would appreciate, if you can ask that from Microsoft on support call, as to why the made it Default On, with no choice to turn it off from the features workspace. You can update us with the answer from Microsoft.
     
  • steinunna Profile Picture
    11 on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    Thanks Sohaib for your detailed answer. It explains a lot!
    I will probably give MS support a chance to solve this.
     
    Just one follow up question. If the flight has now become a fully released feature, why can't I find it in feature management? Is it just a flight that is on by default? 
  • Sohaib Cheema Profile Picture
    47,027 User Group Leader on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    SysTestFlightingManager is used specifically for tests only. It lets developers enable or disable flights temporarily during automated test runs, without affecting actual feature settings.

    On the other hand, the Flight class controls real feature rollout in production and preview environments, using lifecycle stages, flights, and kill switches.
    To disable a feature, you either turn off its flight or activate its kill switch, which forces it off even if it was on by default.
     
    therefore, first thing
    1) Flight (X++ class) = real feature control
    2) SysTestFlightingManager (X++) = temporary control for test scenarios
     
    Not all the time you would have record in the table SYSFLIGHTING (which you can manipulate). 
     
    If you look at the Microsoft DLL (which is behind the whole logic of Flight class), here is the matrix/table you will end up with, that shows not all the time features are controlled by Flight, sometimes those are on by Default. 
     
    Stage Description Available To Enabled By Can Be Disabled By
    Incomplete Microsoft internal only Microsoft dev/test environments Internal environment + Flight No Logic
    PrivatePreview Opt-in preview users Microsoft + selected customers Flight Kill switch
    PublicPreview Public rollout (default on) All customers Default Kill switch
    Released Fully released feature All customers Default Kill switch
     
    Please note that above table may not be perfect with all details/scenarios, I have tried my best to make it, after reading code in the DLL (Microsoft.Dynamics.ApplicationPlatform.FeatureExposure)
     
    For your case, your feature is on by default using a calls named DisableDefaultFilterForSysDataBaseLogFlight
    This class DisableDefaultFilterForSysDataBaseLogFlight is a subclass of an Interface(another X++ class) named Flight.
     
    You can try two things from here:
     
    1) try to disable the feature using the class DisableDefaultFilterForSysDataBaseLogFlight (Which it would NOT allow you because it is an internal object for that model and you cannot extend it in your model). So that option is no more available for you. 
     
    2) Contact Microsoft with a support call, and explain them why you do not want this feature on with the business Impact.
     
    Microsoft's DLL logic behind the Flight class [Microsoft.Dynamics.ApplicationPlatform.FeatureExposure]
     
     
     
     
  • steinunna Profile Picture
    11 on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    Thanks for your answer Martin.
     
    There was no record for this flight in SysFlighting table. So I added one using a runnable class:
    internal final class RunnableClass1
    {
        /// <summary>
        /// Class entry point. The system will call this method when a designated menu 
        /// is selected or when execution starts and this class is set as the startup class.
        /// </summary>
        /// <param name = "_args">The specified arguments.</param>
        public static void main(Args _args)
        {
            
            SysTestFlightingManager::setFlightEnabled('DisableDefaultFilterForSysDataBaseLogFlight', DefaultNoYes::Yes);
        }
    }
    
    I restarted the IIS and tested the form and no change to the functionality.
     
    Then I tested creating the flight with enabled = No, just in case I was misunderstanding the use. But had the same results after restarting the IIS. The filter is always applied.

    Am I missing some steps to this?
     
  • Martin Dráb Profile Picture
    235,397 Most Valuable Professional on at
    How to disable flight DisableDefaultFilterForSysDataBaseLogFlight in form SysDatabaseLog
    What are the steps that you've already tried? Suggesting you what you already did wouldn't help you, but we don't know what it is.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Alireza Eshaghzadeh Profile Picture

Alireza Eshaghzadeh 799 Super User 2025 Season 2

#2
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 757 Super User 2025 Season 2

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 751 Super User 2025 Season 2

Product updates

Dynamics 365 release plans