Clear codeunit SingleInstance (PC0016)
Calling Clear on a SingleInstance codeunit clears the instance’s state, which affects all code using that singleton throughout the session. This is often unintentional and can cause subtle bugs.
Example
The following code clears a SingleInstance codeunit:
codeunit 50100 MyCodeunit
{
procedure ResetCache()
var
CacheMgmt: Codeunit "Cache Management"; // SingleInstance codeunit
begin
Clear(CacheMgmt); // Clear codeunit SingleInstance [PC0016]
end;
}
Consider whether clearing the singleton is truly the intended behavior. If you need to reset specific state, provide explicit reset methods instead.