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…

Comment List
Related
Recommended