Skip to content

Commit 6021723

Browse files
committed
Merge branch 'main' into platform-library-react-controls-preview
2 parents 8fb963d + fdff361 commit 6021723

File tree

2 files changed

+68
-22
lines changed

2 files changed

+68
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
href: use-iframe-and-web-resource-controls-on-a-form.md
1414
- name: Customize views
1515
href: customize-entity-views.md
16-
- name: Open forms, views, dialogs, and reports with a URL
16+
- name: Open apps, forms, views, dialogs, and reports with a URL
1717
href: open-forms-views-dialogs-reports-url.md
1818
items:
1919
- name: Set column values using parameters passed to a form

powerapps-docs/developer/model-driven-apps/open-forms-views-dialogs-reports-url.md

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: "Open forms, views, dialogs, and reports with a URL (model-driven apps) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
2+
title: "Open apps, forms, views, dialogs, and reports with a URL (model-driven apps) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Learn more about URL addressable elements that enable you to include links to forms, views, dialogs, and reports in other applications" # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.author: jdaly
55
author: HemantGaur
66
manager: evchaki
7-
ms.date: 04/01/2022
7+
ms.date: 04/06/2022
88
ms.reviewer: jdaly
99
ms.topic: "article"
1010
ms.subservice: mda-developer
@@ -16,24 +16,65 @@ search.app:
1616
contributors:
1717
- JimDaly
1818
---
19-
# Open forms, views, dialogs, and reports with a URL
19+
# Open apps, forms, views, dialogs, and reports with a URL
2020

21-
URL addressable elements enable you to include links to forms, views, dialogs, and reports in other applications. In this manner, you can easily extend other applications, reports, or websites so that users can view information and perform actions without switching applications.
21+
URL addressable elements enable you to include links to apps, forms, views, dialogs, and reports in other applications.
2222

2323
> [!NOTE]
24-
> - URL addressable forms, views, dialogs, and reports cannot bypass the security. Only licensed users, based on their security roles, can access the data and the records they see.
25-
> - Use `Xrm.Navigation.`[openForm](clientapi/reference/Xrm-Navigation/openForm.md) when you open forms programmatically within the application by using web resources. Do not use `window.open`.
26-
> - Outside the application, where pages do not have access to the `Xrm.Navigation.`[openForm](clientapi/reference/Xrm-Navigation/openForm.md) function, use `window.open` or a link to open a specific record or form for a table.
24+
> URL addressable apps, forms, views, dialogs, and reports cannot bypass the security. Only licensed users, based on their security roles, can access the data and the records they see.
25+
26+
## App Urls
27+
28+
> [!NOTE]
29+
> Embedding a model-driven application within an IFrame in another application is not supported.
30+
31+
You can open any model-driven application using the [AppModule.UniqueName](/powerapps/developer/data-platform/reference/entities/appmodule#BKMK_UniqueName) or [AppModule.AppModuleId](/powerapps/developer/data-platform/reference/entities/appmodule#BKMK_AppModuleId) values.
32+
33+
You can retrieve these values using Web API using the following query:
34+
35+
```http
36+
GET [Organization URI]/api/data/v9.1/appmodules?$select=appmoduleid,uniquename
37+
```
38+
39+
More information: [Query data using the Web API](../data-platform/webapi/query-data-web-api.md)
40+
41+
You can use either the `appname` or `appid` query parameters with the Unique Name or AppModuleId values respectively, but you cannot use both at the same time.
42+
43+
### Using Unique Name
44+
45+
Append the `appname` query parameter to the `main.aspx` page to open the app using the Unique Name.
46+
47+
```
48+
https://myorg.crm.dynamics.com/main.aspx?appname={UniqueName}
49+
```
50+
51+
For example, if the Unique Name is `msdyn_SolutionHealthHub`, you can open this app using this URL:
52+
53+
```
54+
https://myorg.crm.dynamics.com/main.aspx?appname=msdyn_SolutionHealthHub
55+
```
56+
57+
### Using AppModuleId
58+
59+
Append the `appid` query parameter to the `main.aspx` page to open the app using the AppModuleId.
60+
61+
```
62+
https://myorg.crm.dynamics.com/main.aspx?appid={AppModuleId}
63+
```
64+
For example:
65+
66+
```
67+
https://myorg.crm.dynamics.com/main.aspx?appid=12fd1cf3-e06e-e911-a95f-000d3a13c42a
68+
```
69+
2770

2871
<a name="BKMK_URLAddressableFormsAndViews"></a>
2972

3073
## URL addressable forms and views
3174

32-
All forms and views are displayed in the main.aspx page. Query string parameters passed to this page control what will be displayed. For example:
33-
34-
To open an account record form for where the id is {91330924-802A-4B0D-A900-34FD9D790829}:
75+
All forms and views are displayed in the `main.aspx` page. Query string parameters passed to this page control what will be displayed. For example:
3576

36-
[!INCLUDE[cc-terminology](../data-platform/includes/cc-terminology.md)]
77+
To open an account record form for where the id is `{91330924-802A-4B0D-A900-34FD9D790829}`:
3778

3879
```
3980
https://myorg.crm.dynamics.com/main.aspx?etn=account&pagetype=entityrecord&id=%7B91330924-802A-4B0D-A900-34FD9D790829%7D
@@ -50,8 +91,8 @@ https://myorg.crm.dynamics.com/main.aspx?etn=contact&pagetype=entitylist&viewid=
5091
```
5192

5293
> [!NOTE]
53-
> Opening forms in a dialog window by using [showModalDialog](/previous-versions/ms536759(v=vs.85)) or [showModelessDialog](https://msdn.microsoft.com/library/ie/ms536761.aspx) is not supported.
54-
>
94+
> - Use `Xrm.Navigation.`[navigateTo](clientapi/reference/Xrm-Navigation/navigateTo.md) or `Xrm.Navigation.`[openForm](clientapi/reference/Xrm-Navigation/openForm.md) when you open forms programmatically within the application by using web resources. Do not use `window.open`.
95+
> - Outside the application, where pages do not have access to the `Xrm.Navigation.openForm` or `Xrm.Navigation.navigateTo` functions, use `window.open` or a link to open a specific record or form for a table.
5596
> Displaying a form within an IFrame embedded in another form is not supported.
5697
5798
You will typically use the [getClientUrl](clientapi/reference/Xrm-Utility/getGlobalContext/getClientUrl.md) method to retrieve the organization root Url for Model-driven apps.
@@ -65,7 +106,7 @@ https://myorg.crm.dynamics.com/main.aspx?etn=contact&pagetype=entitylist&viewid=
65106
>
66107
> `<https://mycrm/myOrg/main.aspx?etc=4&id=%7b899D4FCF-F4D3-E011-9D26-00155DBA3819%7d&pagetype=entityrecord>`.
67108
>
68-
> The id parameter passed to the URL is the encoded id value for the record. In this example the id value is `{899D4FCF-F4D3-E011-9D26-00155DBA3819}`. The encoded version of the GUID substitutes opening and closing brackets “{” and “}” with %7B and %7D, respectively,
109+
> The id parameter passed to the URL is the encoded id value for the record. In this example the id value is `{899D4FCF-F4D3-E011-9D26-00155DBA3819}`. The encoded version of the GUID substitutes opening and closing brackets `{` and `}` with `%7B` and `%7D`, respectively,
69110
70111
The following are the query string parameters used with the main.aspx page to open forms or views:
71112

@@ -114,7 +155,7 @@ To display a list of table records within the application for a SubArea set the
114155
However, if you want to have a SubArea element that uses a specific initial default view, use the following Url pattern.
115156

116157
```xml
117-
Url=/main.aspx?appid=e2bc1066-488f-eb11-b1ac-000d3a56ead9&pagetype=entitylist&etn=account&viewid=%7b<GUID value of view id>%7d
158+
Url="/main.aspx?appid=e2bc1066-488f-eb11-b1ac-000d3a56ead9&pagetype=entitylist&etn=account&viewid=%7b<GUID value of view id>%7d"
118159
```
119160

120161
When you use this URL, you must also specify appropriate values for `<Titles>` and `<Descriptions>`, and specify an icon for the table.
@@ -126,6 +167,9 @@ Url=“/main.aspx?appid=e2bc1066-488f-eb11-b1ac-000d3a56ead9&pagetype=entitylist
126167

127168
## Opening a dialog process by using a URL
128169

170+
> [!IMPORTANT]
171+
> [Dialogs are deprecated](/power-platform/important-changes-coming#process-dialogs-are-deprecated). You should replace dialogs with business process flows or canvas apps. More information: [Replace dialogs with business process flows or canvas apps](/power-automate/replace-dialogs)
172+
129173
A common customization is to enable a user to open a specific dialog process in the context of a specific record. For example, you might want to add a custom button to the ribbon for a specific table using the id value for current record as an input parameter for the dialog process.
130174

131175
To open a dialog you need the following:
@@ -145,7 +189,7 @@ To open a dialog you need the following:
145189
[organization url]/cs/dialog/rundialog.aspx?DialogId=[dialog unique identifier]&EntityName=[table logical name]&ObjectId=[unique identifier for the record]
146190
```
147191

148-
For example, to open the dialog with id ={6A6E93C9-1FE6-4C07-91A9-E0E2A7C70976} with the account record id = {40C9ADFD-90A8-DF11-840E-00155DBA380F}, use the URL in the following example.
192+
For example, to open the dialog with id =`{6A6E93C9-1FE6-4C07-91A9-E0E2A7C70976}` with the account record id = `{40C9ADFD-90A8-DF11-840E-00155DBA380F}`, use the URL in the following example.
149193

150194
```
151195
[organization url]/cs/dialog/rundialog.aspx?DialogId=%7b6A6E93C9-1FE6-4C07-91A9-E0E2A7C70976%7d&EntityName=account&ObjectId=%7b40C9ADFD-90A8-DF11-840E-00155DBA380F%7d
@@ -168,8 +212,10 @@ function openDialogProcess(dialogId, entityName, objectId)
168212
}
169213
```
170214

171-
<a name="BKMK_OpenReportWithURL"></a>
172-
## Opening a Report by using a URL
215+
<a name="BKMK_OpenReportWithURL"></a>
216+
217+
## Opening a Report by using a URL
218+
173219
You can open a report by passing appropriate parameter values to the following URL: `[organization url]/crmreports/viewer/viewer.aspx`.
174220

175221
This URL accepts the following parameters:
@@ -185,12 +231,14 @@ function openDialogProcess(dialogId, entityName, objectId)
185231

186232
The following examples show URLs that can be used to open reports in model-driven apps.
187233

188-
Open the **Neglected Cases** report using the default filter:
234+
Open the **Neglected Cases** report using the default filter:
235+
189236
```
190237
[organization url]/crmreports/viewer/viewer.aspx?action=run&helpID=Neglected%20Cases.rdl&id=%7b8c9f3e6f-7839-e211-831e-00155db7d98f%7d
191238
```
192239

193240
Open the **Top Knowledge Base Articles** report and prompt the user to set filter values:
241+
194242
```
195243
[organization url]/crmreports/viewer/viewer.aspx?action=filter&helpID=Top%20Knowledge%20Base%20Articles.rdl&id=%7bd84ec390-7839-e211-831e-00155db7d98f%7d
196244
```
@@ -222,6 +270,4 @@ function getReportURL(action,fileName,id) {
222270
[Web resources](web-resources.md)<br/>
223271
[Change application navigation using the SiteMap](../../maker/model-driven-apps/create-site-map-app.md)
224272

225-
226-
227273
[!INCLUDE[footer-include](../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)