getGlobalContext.client (Client API reference)
Provides access to the methods to determine which client is being used, whether the client is connected to the server, and what kind of device is being used.
var clientContext = Xrm.Utility.getGlobalContext().client
The following methods are available for the client context.
getClient
Returns a value to indicate which client the script is executing in.
Syntax
clientContext.getClient()
Return Value
Type: String
Description: The values returned are:
Value | Client |
---|---|
Web |
Web application |
Web |
Unified Interface |
Outlook |
Dynamics 365 for Outlook client (COM add-in) |
Mobile |
Mobile app |
getClientState
Returns a value to indicate the state of the client. A client in offline-first mode (in preview) always indicates it's offline.
Syntax
clientContext.getClientState()
Return Value
Type: String
Description: The values returned are:
Value | Client |
---|---|
Online |
Web application, Dynamics 365 for Outlook client (COM add-in), Mobile app, Unified Interface |
Offline |
Outlook, Mobile app |
getFormFactor
Returns information about the kind of device the user is using.
Syntax
clientContext.getFormFactor()
Return Value
Type: Number
Description: The values returned are:
Value | Form Factor |
---|---|
0 |
Unknown |
1 |
Desktop |
2 |
Tablet |
3 |
Phone |
isOffline
Returns information whether the client state is online or offline. A client in offline-first mode always reports it's offline.
Syntax
clientContext.isOffline()
Return Value
Type: Boolean
Description: true if the server is offline; false otherwise.
isNetworkAvailable
Returns information whether the network is available or not, regardless of client mode.
Note
This API is not available for Dynamics 365 Customer Engagement on-premise deployments. More information: Client APIs not supported in Customer Engagement (on-premises)
Syntax
clientContext.isNetworkAvailable()
Return Value
Type: Boolean
Description: true if the network is available; false otherwise.
Related articles
Organization Settings
User Settings
Xrm.Utility.getGlobalContext
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기