> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debugging CRMScript modules

CRMScript modules are scripts imported into other scripts files by using the `#included` directive.

Historically, you couldn't run CRMScript modules. Now, scriptwriters **can use environment variables** to invoke and debug module scripts:

* developmentMode
* includeId

## Debugging modules

`developmentMode` and `includeId` are set only when the script is run inside the code editor. To access them, call `getVariable()`. For example:

```crmscript theme={null}
getVariable("includeId");
```

When the **Execute script** button is clicked, the engine sets `developmentMode*` to **true** and `includeId` to the includeId of the current script.

This lets you incorporate global code in your CRMScript:

```crmscript theme={null}
// my global script

String foo() {
    return "Foo";
}

String bar() {
    return "Bar";
}

if (getVariable("developmentMode") == "true" && getVariable("includeId") == "foobar")
{
  printLine(foo() + bar());
}
```

* When editing your module library, only the part inside the `if` statement is run by the **Execute script** click event.

* When the library is included in production code, the debug code is not run when the production code is.


## Related topics

- [Logging in CRMScript](/en/automation/crmscript/debugging/helper-functions-for-logging.md)
- [NSModuleLicense](/en/automation/crmscript/reference/CRMScript.NetServer.NSModuleLicense.md)
- [Enum NotificationPlatform](/en/automation/crmscript/reference/CRMScript.NetServer.NotificationPlatform.md)
- [NSModuleLicenseLink](/en/automation/crmscript/reference/CRMScript.NetServer.NSModuleLicenseLink.md)
- [NSExtendedModuleLicense](/en/automation/crmscript/reference/CRMScript.NetServer.NSExtendedModuleLicense.md)
- [NSGrantedModuleLicense](/en/automation/crmscript/reference/CRMScript.NetServer.NSGrantedModuleLicense.md)
