Getting Information Regarding the Current Context
This document describes how to get information regarding the current context, for example the current user’s Sage X3 user code.
In a Sage X3 session, basic global context information is provided in an instance of the WMACONTEXT class. This instance is called [V]GACTX
. Each class instance includes a reference to this context class named ACTX.
Whenever this
(which corresponds to the current class) is available in an event, you can retrieve information using this.ACTX.
as shown in the examples below:
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 no current class instance is open, you can still retrieve information using GACTX.
Note: You should only use GACTX when there is no current class with the referenced context class.
Examples:
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 WMACONTEXT context class.
Refer to the Context Dictionary or the Developer Guide context documentation for more information.