currentuserdomainname is a legacy OCL operator for developers who need the Windows domain name of the user currently logged in to a WPF client machine.
When to use it
Use this operator only when your logic specifically needs the Windows domain of the interactive user on a Windows client.
For example, a WPF client running under a user account in a Windows domain can use the operator to obtain that domain name for client-side logic.
Client and server behavior
The operator is primarily intended for client-side use in WPF.
On the server, the logged-in Windows user is typically a server account, not the person using the application. Do not use this operator on the server when you need to identify the application user.
| Situation | Meaning of the returned identity | Recommended approach |
|---|---|---|
| WPF client-side logic | The Windows identity belongs to the person logged in to that client machine. | Use currentuserdomainname only if you need the Windows domain name. |
| Server-side logic | The Windows identity can be the account under which the server runs. | Do not treat it as the application user's identity. |
| Application-user logic | The required identity is the user of the application, rather than the Windows account. | Use SysSingleton.oclSingleton.CurrentUser.
|
Get the application user instead
Use the following pattern when your expression must work with the application user:
SysSingleton.oclSingleton.CurrentUserFor example, use this pattern when deciding which records, settings, or actions belong to the signed-in application user. This avoids tying application behavior to the Windows account used by the client or server process.
Important limitations
- This is a legacy way to obtain a Windows domain name.
- Its intended use is WPF client-side logic.
- On the server, it can identify a server account rather than the application user.
- Do not use a Windows-domain value as a substitute for
SysSingleton.oclSingleton.CurrentUserin application-user logic.
