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_LOCAL Local char AFOLDER_LOCAL Local char LAN_LOCAL Local char LANISO_LOCAL Local char LOGIN_LOCAL # current connected User code USER_LOCAL = this.ACTX.USER # current folder name AFOLDER_LOCAL = this.ACTX.AFOLDER # three character language code LAN_LOCAL = this.ACTX.LAN # five character ISO language code LANISO_LOCAL = this.ACTX.LANISO # current login information LOGIN_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_LOCAL Local char AFOLDER_LOCAL Local char LAN_LOCAL Local char LANISO_LOCAL Local char LOGIN_LOCAL USER_LOCAL = GACTX.USER AFOLDER_LOCAL = GACTX.AFOLDER LAN_LOCAL = GACTX.LAN LANISO_LOCAL = GACTX.LANISO LOGIN_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.