Consultor Eletrônico



Kbase P121732: Dynamics - How to get the user name in a database trigger?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/22/2007
Status: Unverified

GOAL:

Dynamics - How to get the user name in a database trigger?

GOAL:

The gshSessionManager handle is not available in a database trigger. How can the current user login name be retrieved in the trigger?

GOAL:

How to get the current user name in a dynamics session?

FACT(s) (Environment):

Progress/WebSpeed Versions
Related Progress Products
Dynamics

FIX:

Use the following code to get the login name or simply the session handle so that other properties can be retrieved. This works in both triggers and application code.

DEFINE VARIABLE h_sessmgr AS HANDLE NO-UNDO.
DEFINE VARIABLE cName AS CHARACTER NO-UNDO.

h_sessmgr = DYNAMIC-FUNCTION('getManagerHandle':U IN TARGET-PROCEDURE, INPUT 'SessionManager').

cName = DYNAMIC-FUNCTION('getPropertyList' IN h_sessmgr, INPUT 'CurrentUserName', INPUT NO).

MESSAGE h_sessmgr SKIP
cName
VIEW-AS ALERT-BOX INFO BUTTONS OK.