OpenWGA 7.7 - TMLScript reference

Design
Method :

getGlobal(name)

On object Design
Usage Returns a TMLScript global that is available for the current design
Description

This method allows to retrieve TMLScript globals with their name as method parameter. It can retrieve normal globals just like globals of design scope.

Normally you access TMLScript globals just by specifying their name in TMLScript code, without using any method. However there are some situations where you will need to use this method instead. For example:

  • If you want to programmatically compose the name of the global to retrieve. For that you can construct the name simply as a string and then and give it to this method as parameter.
  • If you want to retrieve a db global that belongs to another design than your current one, so you are not able to access it normally. In that situation you can retrieve a Design object for the design that it belongs to and then use this method to retrieve the global.
Parameters

name (String):

The name of the global

Return value The TMLScript global that is available to the current design under the given name or null if there is none
Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Examples

Retrieving a TMLScript global "Tools" from the design of app "intranet", which may not be visible to my current code as it is a "db global".

var tools = WGA.design("intranet").getGlobal("Tools");