Business Central Fall Cleanup

Lots of customers are in the process to move to that latest and greatest.  Me personally, I’m looking forward to have all our customers on v25, not in the least for the new “Modern Search” ;-).

Though – there have been some caveats you have to be aware of.  Things Microsoft is aware of, and is fixing for future upgrades, but too late for the ones that are already upgraded, which might mean you have to clean up (at least, if you care about having a clean database).

The issue

You must have heard about the new “Subscription Billing” capabilities in Business Central.  A new app that Microsoft bought from an ISV (no idea which one, but educated guess: a German ISV (read further why .. 😉)), and is now included in the default BC offering.  Very useful for customers that really need this functionality. 

But for others that don’t need it, it turned out that Microsoft forced the install to ALL upgraded environments. 

In short: if you or your customers have upgraded their environments, you have “Subscription Billing” in your system, whether you need it or not! 

This is not the first time.  This actually happens more than often.  But sometimes, people wonder why.  Remember Shopify?  “Why do I get a Shopify connector while I don’t need it?”

Is it a problem though?  Well – in my opinion – it’s just for significant functionalities like this, that I have my doubts. I mean, in case of “Subscription Billing”:

  • What with customers that had the ISV app already installed, and now have 2 very similar functionalities, fields, actions, .. In the system?  Sounds very confusing to me…
  • Or customer that already has a similar solution, but different?
  • What with customers that really don’t need it?
  • What about the confusion regarding “service contracts”?  What if customers actively using that, and now “some other contracts” pop up in the system?

And – that’s not really the problem I want to address in this post. We can remove the app, done deal.  But in this case, when you’d remove the Subscription Billing app, it would not clean up everything. 

The real issue is that this version of the Subscription Billing app is adding data to all companies of your environment.  Namely:

  • Number series
  • Source Code
  • Job Queue Entry
  • Data Extension Definitions
  • Last but not least: a dimension (no joke!)

That’s data that won’t be removed when you uninstall the app, because it’s data in default tables.

Let this be a lesson for everyone: don’t create data when installing an app! There are other ways to deal with that!

Microsoft is aware and working on a fix

That’s a good thing, of course.  Let’s put off upgrades until they have. 

Though I don’t doubt Microsoft’s abilities, I personally do not see how it’s going to be possible to reliably clean up the data that has been generated.  Just because they cannot be sure if it was added by the extension, or added by a user for some other reason.. .

And how are they going to do that?  There is no OnUninstall-trigger?  Or by an upgrade codeunit in the app … which we try to uninstall?  Or the base application?  Or mysterious code that alters data in the database (can’t imagine they’d ever do that). And even more – given the data and how it is created, I don’t see a reliable algorithm to remove the data.

So – I want to help .. simply by listing what you can do to clean up yourself.

How to clean up

Here’s a list and some explanations of what data we’re talking about, and what to take into account to remove it.

And remember: to be done in each company!

Dimension

A “hardcoded” dimension is created by means of a label:

CustContractDimensionCodeLbl: Label 'CUSTOMERCONTRACT';

And be careful, this label is being translated!  So it could be different in your language, as it is in one of ours (in Dutch):

This dimension is created, to be able to set up in the General Ledger:

That’s a new field, but you can use that field to verify what dimension it is, if it’s translated or not, and if you want to remove it or not.  Obviously, you don’t want to remove a dimension that you were actually using already – so if by chance, you already had the same Dimension Code, do know this dimension IS going to be set up as a dimension for the functionality of this app as well, because it will skip the creating of the Dimension

and WILL set it up

In my opinion, that’s another kind of bug!  Why would it reuse a dimension that might be (in fact most probably is) there for a whole other reason, but happens to have the same name? 

That said – the fact that the code might have existed, and the fact that it’s a translated label, makes me wonder how anyone is going to be able to decide if the code pre-existed or not, and in what language?  From the audit fields?  Isn’t that a bit too much of assumptions?

Number series

The app also creates 3 number series.  And also these are translated!

And also – which is the strangest part – if one of these already existed, it will take that and set up in the “Service Contract Setup” table  (look at our translated versions of the number series).

So by a very small chance, but still a chance, it could be that a new app is going to ALSO use your already existing number series.

To clean up: use the “Service Contract Setup” to find which number series we’re talking about here (and which language) – which you can just delete if you don’t need them. Be mindful: for Service, it’s called “ServObj”, not “ServContr”!

Source Code

Again same story: a source code “CONTDEFREL” will be created (if it didn’t exist yet) and set up in the Source Code Setup.

This one was not translated, but I can’t say for sure for all languages: the label that was used, was not locked:

To clean up, look into this field in the Source Code Setup, and delete if appropriate (not used anywhere else).

Job Queue Entry

The installation also creates a record in the Job Queue Entry: “Update Serv. Comm. Term. Dates”. 

So .. If you uninstall the app, this record will still be there.  Obviously, it can’t find the caption anymore, but the record will still be there, like so:

To clean up: just remove this Job Queue Entry.

Data Extension Definitions

All of the above was created with one install codeunit.  However, there is one more install codeunit, which takes care of creating a new “Data Extension Definition”.  This time, it’s not translated, as the labels are Locked:

Not sure why it seems to be a German-only thing (look at the culture info – yep, this is why I think it’s from a German ISV 🤪), but anyway… this is probably my CodeReview-genes kicking in.. 🙈

Obviously, just like any other data that was created, after an uninstall of the extension, this “Data Exchange Definition” will still be there.  Just find “USAGEBASED” and delete it to clean up that last piece of data.

That’s it.  Now repeat for each company! 🤪

5.00 avg. rating (99% score) - 5 votes

Permanent link to this article: https://www.waldo.be/2024/11/29/uninstalled-but-not-forgotten-cleaning-up-subscription-billings-residue/

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.