AgileApps Support Wiki Pre Release

getEnv

From AgileApps Support Wiki
Revision as of 01:33, 21 April 2011 by imported>Aeric
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
getEnv(String key)
Description
Gets the environment variable value for the key via the Java API

Syntax

<syntaxhighlight lang="java" enclose="div">

String = Functions.getEnv(String variable) </syntaxhighlight>

Environment Variable Constants

The following constants can be used as keys to access the environment variables:
Key Variable
ENV.USER.ID Logged in user's ID
ENV.USER.EMAIL Logged in user's email
ENV.USER.USER_NAME Logged in user's username
ENV.USER.FULL_NAME Logged in user's full name
ENV.USER.COMPANY_NAME Logged in user's company name
ENV.USER.TIME_ZONE Logged in user's timezone
ENV.COMMUNITY.TENANT.ID The community tenant ID
ENV.MSP.ID The ID of the MSP for this tenant. Blank if the current tenant is not under an MSP.
ENV.SESSION.ID ID of the logged in user's session
ENV.ISV.RECAPTCHA_PUBLIC_KEY Key used when verifying that the system is interacting with a person. Learn more: recaptcha.

Return

The value of the environment variable as a String.
Example
This example calls getEnv to get the current user's identifier.
<syntaxhighlight lang="java" enclose="div">

String userID = Functions.getEnv(ENV.USER.ID); </syntaxhighlight>