Skip to content

Commit e0c99bd

Browse files
authored
Merge pull request #8696 from MicrosoftDocs/jdaly-main-4739
Model-driven App client API cleanup
2 parents 19bc0f1 + eb1fab1 commit e0c99bd

File tree

337 files changed

+1385
-2790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+1385
-2790
lines changed

powerapps-docs/developer/model-driven-apps/client-scripting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Model-driven apps provides you a rich set of **client APIs** to interact with fo
5353
[Client API reference](clientapi/reference.md)
5454

5555

56-
### Related topics
56+
### Related articles
5757

5858
[Web resources for model-driven apps](web-resources.md)<br/>
5959
[Customize commands and the ribbon](customize-commands-ribbon.md)<br/>

powerapps-docs/developer/model-driven-apps/clientapi/clientapi-execution-context.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@ The execution context is passed in one of the following ways:
3737
The execution context object provides a number of methods to further work with the context. More information: [Execution context (Client API reference)](reference/execution-context.md)
3838

3939

40-
### Related topics
40+
### Related articles
4141

4242
[Client API form context](clientapi-form-context.md)<br>
4343
[Client API grid context](clientapi-grid-context.md)<br>
4444
[Form and grid context in ribbon actions](../pass-data-page-parameter-ribbon-actions.md#form-and-grid-context-in-ribbon-actions)
4545

46-
47-
48-
4946
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

powerapps-docs/developer/model-driven-apps/clientapi/clientapi-form-context.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Provides properties and methods to work with the data on a form, including table
7070

7171
| Object | Description|
7272
|----------|-------------------------------------------------------------------------------------------------------------------|
73-
|attributes|Collection of non-table data on the form. Items in this collection are of the same type as the column collection, but they are not columns of the form table. <br/>More information: [Collections](reference/collections.md)|
74-
|entity |Provides methods to retrieve information specific to the record displayed on the page, the save method, and a collection of all the columns included on the form. Column data is limited to columns represented on the form. <br/>More information: [formContext.data.entity](reference/formContext-data-entity.md)|
75-
|process |Provides objects and methods to interact with the business process flow data on a form.<br/>More information: [formContext.data.process](reference/formContext-data-process.md)|
73+
|`attributes`|Collection of non-table data on the form. Items in this collection are of the same type as the column collection, but they are not columns of the form table. <br/>More information: [Collections](reference/collections.md)|
74+
|`entity`|Provides methods to retrieve information specific to the record displayed on the page, the save method, and a collection of all the columns included on the form. Column data is limited to columns represented on the form. <br/>More information: [formContext.data.entity](reference/formContext-data-entity.md)|
75+
|`process`|Provides objects and methods to interact with the business process flow data on a form.<br/>More information: [formContext.data.process](reference/formContext-data-process.md)|
7676

7777
It also provides an **attributes** collection for accessing non-table bound control. See the **Collections in the formContext object model** section later in this topic.
7878

@@ -84,9 +84,9 @@ Provides methods to retrieve information about the user interface, in addition t
8484

8585
| Object | Description|
8686
|-----------------|----------------|
87-
|formSelector |Provides an items collection that provides capabilities to query the forms available for the current user. Use the navigate method to close the current form and open a different one.|
88-
|navigation |Does not contain any methods. Provides access to navigation items through the items collection. See the next section on collections for more information.|
89-
|process |Provides methods to interact with the business process flow control on a form.|
87+
|`formSelector`|Provides an items collection that provides capabilities to query the forms available for the current user. Use the navigate method to close the current form and open a different one.|
88+
|`navigation`|Does not contain any methods. Provides access to navigation items through the items collection. See the next section on collections for more information.|
89+
|`process`|Provides methods to interact with the business process flow control on a form.|
9090

9191
More information: [formContext.ui](reference/formContext-ui.md)
9292

@@ -108,16 +108,13 @@ information about the methods available for collections in general, see [Collect
108108

109109

110110

111-
### Related topics
111+
### Related articles
112112

113-
[getFormContext method](reference/executioncontext/getFormContext.md)<br/>
114-
[getGlobalContext method](reference/xrm-utility/getGlobalContext.md)<br/>
115-
[getAttribute method](reference/attributes.md)<br/>
116-
[getControl method](reference/controls/getcontrol.md)<br/>
113+
[getFormContext method](reference/executioncontext/getFormContext.md)
114+
[getGlobalContext method](reference/xrm-utility/getGlobalContext.md)
115+
[getAttribute method](reference/attributes.md)
116+
[getControl method](reference/controls/getcontrol.md)
117117
[Execution context methods](reference/execution-context.md)
118118

119-
120-
121-
122119

123120
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

powerapps-docs/developer/model-driven-apps/clientapi/clientapi-grid-context.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ function doSomething(executionContext) {
3636
}
3737
```
3838

39-
## Related topics
39+
## Related articles
4040

41-
[Client API form context](clientapi-form-context.md)<br/>
42-
[Client API execution context](clientapi-execution-context.md)<br/>
43-
[Understand the Client API object model](understand-clientapi-object-model.md)<br/>
41+
[Client API form context](clientapi-form-context.md)
42+
[Client API execution context](clientapi-execution-context.md)
43+
[Understand the Client API object model](understand-clientapi-object-model.md)
4444
[Grids and subgrids](reference/grids.md)
4545

4646

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ The following illustration displays the Xrm object model:
2929

3030
Here is the information about each of the namespaces in the Xrm object:
3131

32-
| Namespace | Description |
33-
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34-
| [Xrm.Device](reference/xrm-device.md) | Provides methods to use native device capabilities. |
35-
| [Xrm.Encoding](reference/xrm-encoding.md) | Provides methods to encode strings. |
36-
| [Xrm.Navigation](reference/xrm-navigation.md) | Provides methods for navigating forms and items in model-driven apps. |
37-
| [Xrm.Panel](reference/xrm-panel.md) | Provides a method to display a web page in the side pane of model-driven apps form. |
38-
| [Xrm.Utility](reference/xrm-utility.md) | Provides a container for useful methods. |
32+
| Namespace| Description|
33+
| ---| ---|
34+
| [Xrm.Device](reference/xrm-device.md)| Provides methods to use native device capabilities. |
35+
| [Xrm.Encoding](reference/xrm-encoding.md) | Provides methods to encode strings.|
36+
| [Xrm.Navigation](reference/xrm-navigation.md) | Provides methods for navigating forms and items in model-driven apps.|
37+
| [Xrm.Panel](reference/xrm-panel.md) | Provides a method to display a web page in the side pane of model-driven apps form.|
38+
| [Xrm.Utility](reference/xrm-utility.md) | Provides a container for useful methods.|
3939
| [Xrm.WebApi](reference/xrm-webapi.md) | Provides methods to use Web API to create and manage records and execute Web API actions and functions.<br/><br/>[Xrm.WebApi.offline](reference/xrm-webapi/offline.md): Provides methods to create and manage records in the model-driven apps in mobile clients while working in _offline_ mode.<br/><br/>[Xrm.WebApi.online](reference/xrm-webapi/online.md): Provides methods to use Web API to create and manage records and execute Web API actions and functions when connected to the server. |
4040

4141
## Client API global context
@@ -47,7 +47,7 @@ Use the **Xrm.Utility**.[getGlobalContext](reference/xrm-utility/getGlobalContex
4747
4848
To access the global context information in a standalone HTML Web resource, you should include a reference to **ClientGlobalContext.js.aspx** in the web resource, and then use the **GetGlobalContext** function. More information: [GetGlobalContext function and ClientGlobalContext.js.aspx](reference/GetGlobalContext-ClientGlobalContext.js.aspx.md)
4949

50-
### Related topics
50+
### Related articles
5151

5252
[Understand the Client API object model](understand-clientapi-object-model.md)<br/>
5353
[Deprecated client APIs](/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming#some-client-apis-are-deprecated)

powerapps-docs/developer/model-driven-apps/clientapi/create-app-side-panes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,6 @@ By switching to use `createPane`, both limitations can be avoided by providing a
146146

147147
### Related articles
148148

149-
[sidePanes (Client API reference)](reference/xrm-app-sidepanes.md)<br />
150-
[loadPanel (Client API Reference)](reference/xrm-panel/loadpanel.md)<br />
149+
[sidePanes (Client API reference)](reference/xrm-app-sidepanes.md)
150+
[loadPanel (Client API Reference)](reference/xrm-panel/loadpanel.md)
151151
[Walkthrough: Write your first client script](walkthrough-write-your-first-client-script.md)

powerapps-docs/developer/model-driven-apps/clientapi/debug-JavaScript-code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ Use the **Run command** (shortcut is `Windows + R`) and use the following deep l
152152

153153
1. Click **inspect** and the DevTools will open.
154154

155-
### See also
155+
### Related articles
156156

157-
[JavaScript web resources](../script-jscript-web-resources.md)<br />
158-
[Debug a model-driven app with Monitor](../../../maker/monitor-modelapps.md)<br />
157+
[JavaScript web resources](../script-jscript-web-resources.md)
158+
[Debug a model-driven app with Monitor](../../../maker/monitor-modelapps.md)
159159
[Troubleshoot issues in the Power Apps mobile app](../../../mobile/powerapps-mobile-troubleshoot.md)
160160

161161
[!INCLUDE[footer-include](../../../includes/footer-banner.md)]

powerapps-docs/developer/model-driven-apps/clientapi/events-forms-grids.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ Using the following methods to add and remove event handler for events that cann
8080
>The execution context is automatically passed as the first parameter to functions that are set using the code. More information: [Client API execution context](clientapi-execution-context.md)
8181
8282
## Form event pipeline
83+
8384
You can define up to 50 event handlers for each event. Each event handler is executed in the order that it is displayed in the **Event Handlers** section in the **Events** tab of the **Form Properties** dialog box.
8485

8586
Use the [setSharedVariable](reference/executioncontext/setSharedVariable.md) and [getSharedVariable](reference/executioncontext/getSharedVariable.md) methods to pass a common variable between event handlers (functions). Use the execution context [getDepth](reference/executioncontext/getDepth.md) method to know the sequence that an event handler is being executed in relative to other event handlers.
8687

87-
### Related topics
88+
### Related articles
8889

89-
[Understand the Client API object model](understand-clientapi-object-model.md)<br/>
90-
[Client API execution context](clientapi-execution-context.md)<br/>
91-
[Events (Client API reference)](reference/events.md)<br/>
90+
[Understand the Client API object model](understand-clientapi-object-model.md)
91+
[Client API execution context](clientapi-execution-context.md)
92+
[Events (Client API reference)](reference/events.md)
9293

9394

9495

powerapps-docs/developer/model-driven-apps/clientapi/get-update-setting-value-using-code.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,23 @@ Settings are solution components that enable developers to quickly configure app
2222
The following functions can be used to get or update a setting value using client API.
2323

2424
### getCurrentAppSetting
25+
2526
Gets the value of a setting for the current app.
2627

2728
#### Syntax
29+
2830
```JavaScript
2931
var settingValue = Xrm.Utility.getGlobalContext().getCurrentAppSetting(settingName);
3032
```
3133

3234
#### Parameters
35+
3336
| Name | Type | Required | Description |
3437
|:--------------|:--------------|:--------------|:-------------------------|
35-
|**settingName** | String | Yes | The name of the setting to get the value for. |
38+
|`settingName` | String | Yes | The name of the setting to get the value for. |
3639

3740
#### Return value
41+
3842
**Type:** Same as the type of the setting: *Number*, *String*, or *Yes/No*<br><br>
3943
**Description:**
4044
- If the setting is *Overridable* and *Value can be overridden* is set to *Environment and app* the setting app value is returned. If a setting app value does not exist, then the setting environment value is returned. If a setting environment value does not exist, the default value as specified in the setting definition is returned.
@@ -44,33 +48,39 @@ var settingValue = Xrm.Utility.getGlobalContext().getCurrentAppSetting(settingNa
4448
- If the setting name is incorrect or the setting could not be found, the return value is null.
4549

4650
### saveSettingValue
51+
4752
Adds or updates the setting app value for the current app or the setting environment value for the current environment.
4853

4954
#### Syntax
55+
5056
```JavaScript
5157
var appOverrideScope = 2; // Add or update a setting app value
5258
var saveSettingOptions = {overrideScope: appOverrideScope, solutionUniqueName: mySolutionName};
5359
Xrm.Utility.getGlobalContext().saveSettingValue(settingName, value, saveSettingOptions).then(successCallback, errorCallback);
5460
```
5561

5662
#### Parameters
63+
5764
| Name | Type | Required | Description |
5865
|:--------------|:--------------|:--------------|:-------------------------|
59-
|**settingName** | String | Yes | The name of the setting to update the value of. |
60-
|**value** | *Number*, *String*, or *Yes/No* | Yes | The value to update the setting to. |
61-
|**saveSettingOptions** | String | No | Options when updating the value. It contains two parameters <ul><li><b>overrideScope</b><ul><li>Use **1** to add or update a setting environment value</li><li>Use **2** to add or update a setting app value.</li><li>If not specified it is set to environment.</li></ul></li><li><b>solutionUniqueName</b><ul><li>The solution to which the setting environment value or setting app value should be added.</li><li>If not specified the default solution is used.</li></ul></li></ul>|
62-
|**successCallback** | String | Yes | A function to call if the update is successful. |
63-
|**errorCallback** | String | Yes | A function to call if the update fails. |
66+
|`settingName` | String | Yes | The name of the setting to update the value of. |
67+
|`value` | *Number*, *String*, or *Yes/No* | Yes | The value to update the setting to. |
68+
|`saveSettingOptions` | String | No | Options when updating the value. It contains two parameters <ul><li><b>overrideScope</b><ul><li>Use **1** to add or update a setting environment value</li><li>Use **2** to add or update a setting app value.</li><li>If not specified it is set to environment.</li></ul></li><li><b>solutionUniqueName</b><ul><li>The solution to which the setting environment value or setting app value should be added.</li><li>If not specified the default solution is used.</li></ul></li></ul>|
69+
|`successCallback` | String | Yes | A function to call if the update is successful. |
70+
|`errorCallback`| String | Yes | A function to call if the update fails. |
6471

6572
#### Return value
73+
6674
On success, returns a promise object.
6775

6876
### Web APIs
77+
6978
You can also use the following Web APIs to get or update a setting value
70-
- [RetrieveSetting Function](/dynamics365/customer-engagement/web-api/retrievesetting)
71-
- [SaveSettingValue Action](/dynamics365/customer-engagement/web-api/savesettingvalue)
7279

73-
## See also
80+
- [RetrieveSetting function](xref:Microsoft.Dynamics.CRM.RetrieveSetting)
81+
- [SaveSettingValue action](xref:Microsoft.Dynamics.CRM.SaveSettingValue)
82+
83+
## Related articles
7484

7585
[Solutions overview](../../../maker/data-platform/solutions-overview.md)
7686

powerapps-docs/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ Editable grid can be used to trigger [OnRecordSelect](reference/events/grid-onre
281281

282282
## Related articles
283283

284-
[Model-driven app custom page overview](../../../maker/model-driven-apps/model-app-page-overview.md)
285-
286-
[Add a custom page to your model-driven app](../../../maker/model-driven-apps/add-page-to-model-app.md)
287-
284+
[Model-driven app custom page overview](../../../maker/model-driven-apps/model-app-page-overview.md)
285+
[Add a custom page to your model-driven app](../../../maker/model-driven-apps/add-page-to-model-app.md)
288286
[navigateTo (client API reference)](reference/xrm-navigation/navigateto.md)
289287

0 commit comments

Comments
 (0)