BC Teardown #16: Thanksgiving leftovers: dead code

BC Teardown #16: Thanksgiving leftovers: dead code

Leftovers are great in the fridge. Not in your extension.

The pain

Your extension still carries objects from projects that ended years ago. Every update, they get compiled, tested and fixed anyway.

Why it happens

Nobody removes old code because nobody is sure what still uses it.

Before: What is still in there

MyExt objects:
  Old EDI import (vendor long gone)
  Promo pricing (never used)
  Report "Copy of Copy of Invoice"
  Page "Test Page Do Not Use"
  Codeunit "Temp Fix (permanent)"

After: Measure, then retire

1. Turn on telemetry
   (Application Insights)
2. See which objects actually run
3. Confirm with the business owner
4. Remove them in the next release

Less code to compile, test and fix
every six months.

The result

A leaner extension that is faster to update, cheaper to test and easier to understand.

Tip: Fields that hold data need an upgrade step before removal, so nothing is lost.

Download this teardown as a PDF


Got a Business Central problem like this? Free 30 minute review of your setup. Senior Microsoft certified developers, and you talk to the person writing the code. Contact Dataflow Solutions.