Skip to content

Commit 85d5a72

Browse files
authored
Merge pull request #2425 from MicrosoftDocs/clientapai-updates
Added new client API
2 parents 3385ad6 + ef27d1b commit 85d5a72

File tree

4 files changed

+64
-4
lines changed

4 files changed

+64
-4
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,8 @@
683683
href: reference/xrm-utility/getGlobalContext/prependOrgName.md
684684
- name: getLearningPathAttributeName
685685
href: reference/xrm-utility/getLearningPathAttributeName.md
686+
- name: getPageContext
687+
href: reference/xrm-utility/getPageContext.md
686688
- name: getResourceString
687689
href: reference/xrm-utility/getResourceString.md
688690
- name: invokeProcessAction
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "getPageContext (Client API reference) in model-driven apps| MicrosoftDocs"
3+
ms.date: 02/25/2020
4+
ms.service: powerapps
5+
ms.topic: "reference"
6+
author: "KumarVivek"
7+
ms.author: "kvivek"
8+
manager: "annbe"
9+
search.audienceType:
10+
- developer
11+
search.app:
12+
- PowerApps
13+
- D365CE
14+
---
15+
# getPageContext (Client API reference)
16+
17+
18+
[!INCLUDE[./includes/getPageContext-description.md](./includes/getPageContext-description.md)]
19+
20+
21+
> [!NOTE]
22+
> This method is supported only on the Unified Interface.
23+
24+
## Syntax
25+
26+
`Xrm.Utility.getPageContext();`
27+
28+
## Returns
29+
30+
The method returns an object with the `input` property. The `input` property is an object with the following attributes depending on whether you are currently on the *entity form* or *entity list*:
31+
32+
### Entity form
33+
34+
|Name |Type |Description|
35+
|--|--|--|
36+
|pageType|String|The current page type. The value returned is "entityrecord".|
37+
|entityName|String|Logical name of the entity currently displayed.|
38+
|entityId|String|ID of the entity record currently displayed in the form.|
39+
|createFromEntity|Lookup|The parent record that provides default values based on mapped attribute values. The lookup object has the following String properties: `entityType`, `id`, and `name`.|
40+
|formId|String|ID of the currently displayed form.|
41+
42+
43+
### Entity list
44+
45+
|Name |Type |Description|
46+
|--|--|--|
47+
|pageType|String|The current page type. The value returned is "entitylist".|
48+
|entityName|String|Logical name of the entity currently displayed.|
49+
|viewId|String|ID of the view currently displayed.|
50+
|viewType|String|Type of the view currently displayed. Possible values are "savedquery" or "userquery".|
51+
52+
> [!NOTE]
53+
> Only the `pageType` and `entityName` parameters will return values every time; all other parameters will return values only if specified by the logic that opened the page.
54+
55+
### Related topics
56+
57+
[Xrm.Utility](../xrm-utility.md)
58+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gets the page context as an object representing the page.

powerapps-docs/developer/model-driven-apps/clientapi/reference/xrm-utility.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
---
22
title: "Xrm.Utility (Client API reference)| MicrosoftDocs"
3-
ms.date: 10/31/2018
3+
ms.date: 02/25/2020
44
ms.service: powerapps
55
ms.topic: "reference"
6-
applies_to: "Dynamics 365 (online)"
7-
ms.assetid: c044f7b8-7803-45fb-b99c-df01800c3b2a
86
author: "KumarVivek"
97
ms.author: "kvivek"
10-
manager: "amyla"
8+
manager: "annbe"
119
search.audienceType:
1210
- developer
1311
search.app:
@@ -29,6 +27,7 @@ Provides a container for useful methods.
2927
|[getEntityMetadata](xrm-utility/getEntityMetadata.md) |[!INCLUDE[./xrm-utility/includes/getEntityMetadata-description.md](./xrm-utility/includes/getEntityMetadata-description.md)]|
3028
|[getGlobalContext](xrm-utility/getGlobalContext.md) |[!INCLUDE[./xrm-utility/includes/getGlobalContext-description.md](./xrm-utility/includes/getGlobalContext-description.md)]|
3129
|[getLearningPathAttributeName](xrm-utility/getLearningPathAttributeName.md) |[!INCLUDE[./xrm-utility/includes/getLearningPathAttributeName-description.md](./xrm-utility/includes/getLearningPathAttributeName-description.md)]|
30+
|[getPageContext](xrm-utility/getPageContext.md) |[!INCLUDE[./xrm-utility/includes/getPageContext-description.md](./xrm-utility/includes/getPageContext-description.md)]|
3231
|[getResourceString](xrm-utility/getResourceString.md) |[!INCLUDE[./xrm-utility/includes/getResourceString-description.md](./xrm-utility/includes/getResourceString-description.md)]|
3332
|[invokeProcessAction](xrm-utility/invokeProcessAction.md) |[!INCLUDE[./xrm-utility/includes/invokeProcessAction-description.md](./xrm-utility/includes/invokeProcessAction-description.md)]|
3433
|[lookupObjects](xrm-utility/lookupObjects.md) |[!INCLUDE[./xrm-utility/includes/lookupObjects-description.md](./xrm-utility/includes/lookupObjects-description.md)]|

0 commit comments

Comments
 (0)