Dynamics 365 Business Central: how to detect if an extension is running on SaaS or on-premise

When developing extensions for Dynamics 365 Business Central, you could have scenarios where you want to execute a procedure or a business process only if the extension is running on a SaaS environment or in an on-premise environment (or maybe having a different behaviour accordingly to the environment).

To check if your extension is running on a SaaS environment, you have now a method called SoftwareAsAService() in the Permission Manager (9002) codeunit. This method returns TRUE if the extension is running on a SaaS environment, FALSE otherwise.

An example of usage:

AL_IsSaaS

I think it’s all self explanatory and very easy. Hoping to have answered a question received today… 😉

2 Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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