Skip to content

Commit 5171dc6

Browse files
authored
Merge pull request #2084 from MicrosoftDocs/navigateto-update
Updated to add info about web resources
2 parents 6011166 + bc907c4 commit 5171dc6

File tree

1 file changed

+85
-7
lines changed
  • powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-Navigation

1 file changed

+85
-7
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-Navigation/navigateTo.md

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "navigateTo (Client API reference) in model-driven apps| MicrosoftDocs"
3-
ms.date: 10/4/2019
3+
ms.date: 11/04/2019
44
ms.service: powerapps
55
ms.topic: "reference"
66
author: "KumarVivek"
@@ -23,15 +23,93 @@ search.app:
2323
2424
## Syntax
2525

26-
`Xrm.Navigation.navigateTo(pageInput).then(successCallback,errorCallback);`
26+
`Xrm.Navigation.navigateTo(pageInput,navigationOptions).then(successCallback,errorCallback);`
2727

2828
## Parameters
2929

30-
|Name |Type |Required |Description |
31-
|---|---|---|---|
32-
|pageInput|Object|Yes|Input about the page to navigate to. The object contains the following attributes:<br/>- **pageType**: String. Specify "entitylist".<br/>- **entityName**: String. The logical name of the entity to load in the list control. <br/>- **viewId**: (Optional) String. The ID of the view to load. If you don't specify it, navigates to the default main view for the entity.<br/>- **viewType**: (Optional) String. Type of view to load. Specify "savedquery" or "userquery".|
33-
|successCallback|function|No|A function to execute on successful navigation to page.|
34-
|errorCallback|function|No|A function to execute when the operation fails.|
30+
<table style="width:100%">
31+
<tr>
32+
<th>Name</th>
33+
<th>Type</th>
34+
<th>Required</th>
35+
<th>Description</th>
36+
</tr>
37+
<tr>
38+
<td>pageInput</td>
39+
<td>Object</td>
40+
<td>Yes</td>
41+
<td><p>Input about the page to navigate to. The object definition changes depending on the type of page to navigate to: <i>entity list</i> or <i>HTML web resource</i>.</p>
42+
<p><strong>entity list</strong>
43+
<p>The object contains the following attributes:</p>
44+
<ul>
45+
<li><strong>pageType</strong>: String. Specify "entitylist".</li>
46+
<li><strong>entityName</strong>: String. The logical name of the entity to load in the list control.</li>
47+
<li><strong>viewId</strong>: (Optional) String. The ID of the view to load. If you don't specify it, navigates to the default main view for the entity.</li>
48+
<li><strong>viewType</strong>: (Optional) String. Type of view to load. Specify "savedquery" or "userquery".</li>
49+
</ul>
50+
<p><strong>HTML web resource</strong>
51+
<p>The object contains the following attributes:</p>
52+
<ul>
53+
<li><strong>pageType</strong>: String. Specify "webresource".</li>
54+
<li><strong>webresourceName</strong>: String. The name of the web resource to load.</li>
55+
<li><strong>data</strong>: (Optional) String. The data to pass to the web resource.</li>
56+
</ul></td>
57+
</tr>
58+
<tr>
59+
<td>navigationOptions</td>
60+
<td>Object</td>
61+
<td>No</td>
62+
<td><p>Options for navigating to a page: whether to open inline or in a dialog. If you don't specify this parameter, page is opened inline by default. The object contains the following attributes:</p>
63+
<ul>
64+
<li><strong>target</strong>: Number. Specify <strong>1</strong> to open the page inline; <strong>2</strong> to open the page in a dialog. <br/><i>Entity lists</i> can only be opened inline; <i>web resources</i> can be opened either inline or in a dialog.</li>
65+
<li><strong>width</strong>: (Optional) Number or Object. The width of dialog. To specify the width in pixels, just type a numeric value. To specify the width in percentage, specify an object of type <b>SizeValue</b> with the following properties:
66+
<ul><li><b>value</b>: Number. The numerical value.</li>
67+
<li><b>unit</b>: String. The unit of measurement. Specify "%" or "px". Default value is "px".</li></ul></li>
68+
<li><strong>height</strong>: (Optional) Number or Object. The height of dialog. To specify the height in pixels, just type a numeric value. To specify the width in percentage, specify an object of type <b>SizeValue</b> with the following properties:
69+
<ul><li><b>value</b>: Number. The numerical value.</li>
70+
<li><b>unit</b>: String. The unit of measurement. Specify "%" or "px". Default value is "px".</li></ul></li>
71+
<li><strong>position</strong>: (Optional) Number. Specify <strong>1</strong> to open the dialog in center; <strong>2</strong> to open the dialog on the side. Default is 1 (center).</li>
72+
</ul></td>
73+
</tr>
74+
<tr>
75+
<td>successCallback</td>
76+
<td>function</td>
77+
<td>No</td>
78+
<td><p>A function to execute on successful navigation to the page when navigating inline and on closing the dialog when navigating to a dialog.</p></td>
79+
</tr>
80+
<tr>
81+
<td>errorCallback</td>
82+
<td>Function</td>
83+
<td>No</td>
84+
<td><p>A function to execute when the operation fails.</p></td>
85+
</tr>
86+
</table>
87+
88+
## Example
89+
90+
The following example demonstrates how to navigate to an HTML web resource that is opened in a dialog:
91+
92+
```javascript
93+
var pageInput = {
94+
pageType: "webresource",
95+
webresourceName: "new_sample_webresource"
96+
};
97+
var navigationOptions = {
98+
target: 2,
99+
width: 400,
100+
height: 300,
101+
position: 1
102+
};
103+
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
104+
function success() {
105+
// Handle dialog closed
106+
},
107+
function error() {
108+
// Handle errors
109+
}
110+
);
111+
```
112+
35113

36114

37115
### Related topics

0 commit comments

Comments
 (0)