GlobalEnv

The globalenv table is a global system table holding the state for the entire database and LemonEdge system for this database.

The globalenv database table is used for holding version and global setting information for the system. These values are global for all accounts within the database unless otherwise specified.

The table itself is a simple key/value table of the following structure:

NameDescription
NameThe name column holds a string value representing the name of a global setting in the database
ValueThe value column holds the corresponding value for the aforementioned name setting.

The standard settings contained within the globalenv table are as follows:

NameDefault ValueDescription
AllowCLRSQLFunctions0Indicates if this database is configured to allow the integration of .net clr sql functions into the database, such as the system standard xirr calculation.
This can not be enabled if you are hosting the database in SQL Azure. However it is compatible with SQL Server or SQL Azure Managed Instances.
See SQL Functions for more information.
DBUpgradeStartedA datetime stampThe last time a database upgrade was initiated
DBUpgradeTimeTakenA time spanThe amount of time the last database upgrade took
DBVersionCurrent VersionThe current version of the database for the LemonEdge platform
LastForcedCacheResetA datetime stampThe last time the server cache was forced to be reset
LockedAPIfalseIndicates the API AddIns are locked and can not be modified through the application.
ReUpgradeAllEntities0Indicates the system should force an upgrade which will recreate all functions/procedures and update the schema.
UpgradingDatabase0Indicates the system (either through a service or directly connected application) is currently upgrading the database.
This will be automatically set to 0 when the upgrade completes.

Note:
The system will not attempt to upgrade while UpgradingDatabase is set to 1, as it will assume another process is still upgrading so will just wait.
If no LemonEdge application is connected to the database processing the upgrade, then this will indicate the flag is "stuck", and no upgrade will start until this is reset to 0 manually.
If you connect directly to the database (rather than via a web service) using the client application it will prompt if you want to force an upgrade if you know the flag is "stuck".


Any custom AddIn also has the ability to store its own settings and version information within globalenv at the database level. For instance the AssetManagement product has the following version setting:

NameDefault ValueDescription
1;;AssetManagementDBVersionAsset Management VersionThe version in the database of the asset management product

All custom addin settings are of the format AccountID;;CustomAddInSettingName within the globalenv database. See the API documentation for more information.