Table of Contents

Debug Flags

Used by event subscribers of the event OnInitializeDebugFlags() in "QWETB Debug Single Instance". Provides functions to add custom Debug Flags. An added Debug Flag can only be used from the app that created it.

Object Definition

Object TypeCodeunit
Object ID70327077
Object NameQWETB Debug Flags

Procedures

Name Description
AddDebugFlag(Text[100]; Text[250]) Adds a debug flag.
AddDebugFlag(Text[100]; Text[250]; Boolean) Adds a debug flag.

Example

Add the Debug Flag

Subscribe to the OnInitializeDebugFlags event to add new Debug Flags

[EventSubscriber(ObjectType::Codeunit, Codeunit::"QWETB Debug Single Instance", 'OnInitializeDebugFlags', '', false, false)]
local procedure InitializeDebugFlags(var DebugFlags: Codeunit "QWETB Debug Flags")
begin
    DebugFlags.AddDebugFlag('The Sample Debug Flag', 'Show a sample message.');
end;

Use the Debug Flag to show message

Use the ShowMessageIfDebugFlagActive() function to show a message if the debug flag is active.

DebugSingleInstance.ShowMessageIfDebugFlagActive('The Sample Debug Flag', 'This is a sample!', true);

Use the Debug Flag as a condition

Use the GetDebugFlagActive() function to check if the debug flag is active.

if DebugSingleInstance.GetDebugFlagActive('The Sample Debug Flag') then
  Message('This is another sample!');

This documentation is generated from Smart Toolbox v27.1