Navigation:  Enterprise Forms Modules > Form Template Manager > Form Template Details >

Enterprise Forms Tokens

Previous pageReturn to chapter overviewNext page

Enterprise Forms tokens is a feature widely used throughout the application.  Its application range databind stored procedure parameters to workflow notification message properties.  A token is a specialized group of characters represent a variable.  When parsed the token is replaced with the corresponding value.  For example a [USERNAME] token is replaced with the real user name of the current logged on user.

 

A token is generally comprise of 2 components, namespace and fieldname with either curly or square brackets surrounded.  The namespace component is the unique name such as FORM, TEMPLATE or QUERY, each containing its own set of field name definitions. For example the FORM namespace cover all field elements exist in the form such as [FORM:firstName] represents the first name value of a field element named "firstName"

 

A typical single bracket token consist of

 

[NAMESPACE:fieldName]

 

with NAMESPACE representing the special name supported by Enterprise Forms.  The current set of supported name spaces include FORM, QUERY, TEMPLATE, USER, EMAIL and URL.  There are also a special set of tokens that do not have a namespace such as [USERNAME].

 

Apart from the single bracket tokens as described above, there are also the double bracket tokens.  The double bracket tokens are another type of special tokens mainly used for advanced processing and translation purposes.  Currently there are two namespaces that use the double bracket format, CODE and FUNCTION.  A CODE token provides the ability to execute a segment of C# code inside the token and have it translated to a value.  A FUNCTION token is a simplified version of the CODE token whereby a set of developed functions provides form developers the ability to manipulate data from other single bracket tokens.

 

A typical double bracket token consist of

 

[[NAMESPACE:fieldName]]

 

with NAMESPACE representing either CODE or FUNCTION and fieldName is the text associated with the namespace.

 

The main difference between single and double bracket tokens is the ability to nest single bracket tokens within a double bracket token.  For example a valid CODE token may look like

 

[[CODE:

       return "Hello " + "[FORM:firstName]";

]]

 

the above CODE token returns the text "Hello Joe" if the value of the firstName field element is "Joe"

 

 

For a complete list of supported tokens refer to the Appendix