How to get information relating to the current context

This ‘How-to’ describes how to get information relating to the current context, for example the current user’s Sage X3 People user code.

In a Sage X3 People session, some basic global context information is provided in an instance of the class 'WMACONTEXT'. This instance is called '[V]GACTX'. Each class instance includes a reference to this context class named ‘ACTX’.

When there is an event where ‘this’ is available (‘this’ refers to the current class) some information can be retrieved using ‘this.ACTX.’. As shown in the following examples:

 Local char USER_LOCALLocal char AFOLDER_LOCALLocal char LAN_LOCALLocal char LANISO_LOCALLocal char LOGIN_LOCAL# current connected User codeUSER_LOCAL = this.ACTX.USER# current folder nameAFOLDER_LOCAL = this.ACTX.AFOLDER# three character language codeLAN_LOCAL = this.ACTX.LAN# five character ISO language codeLANISO_LOCAL = this.ACTX.LANISO# current login informationLOGIN_LOCAL = this.ACTX.LOGIN

If ‘this’ is not available, because there is no current class instance open, the information can still be retrieved by using ‘GACTX’.

You should only use ‘GACTX’ when there is no current class with the referenced context class.

Examples similar to those above:

 Local char USER_LOCALLocal char AFOLDER_LOCALLocal char LAN_LOCALLocal char LANISO_LOCALLocal char LOGIN_LOCALUSER_LOCAL = GACTX.USERAFOLDER_LOCAL = GACTX.AFOLDERLAN_LOCAL = GACTX.LANLANISO_LOCAL = GACTX.LANISOLOGIN_LOCAL = GACTX.LOGIN

Additional information is stored in the context class 'WMACONTEXT'.

For more information, see the Workbench reference Context dictionary or the Developer guide context documentation.