Tapahtumat
14. helmik. klo 16 - 31. maalisk. klo 16
Kun sinulla on neljä mahdollisuutta osallistua, voit voittaa konferenssipaketin ja päästä LIVE Grand Finaleen Las Vegasissa
LisätietojaTätä selainta ei enää tueta.
Päivitä Microsoft Edgeen, jotta voit hyödyntää uusimpia ominaisuuksia, suojauspäivityksiä ja teknistä tukea.
Navigates to the specified table list, table record, HTML web resource, or custom page.
Huomautus
This method is supported only on Unified Interface.
Xrm.Navigation.navigateTo(pageInput,navigationOptions).then(successCallback,errorCallback);
Name | Type | Required | Description |
---|---|---|---|
pageInput | Object | Yes | Input about the page to navigate to. See pageInput parameter |
navigationOptions | Object | No | 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. |
successCallback |
function | No | A function to execute on successful navigation to the page when navigating inline and on closing the dialog when navigating to a dialog. |
errorCallback |
Function | No | A function to execute when the operation fails. |
The object definition changes depending on the type of page to navigate to: entity list, entity record, dashboard, HTML web resource, or custom page.
The entity list object contains the following values.
Name | Type | Description |
---|---|---|
pageType |
String | Specify entitylist . |
entityName |
String | The logical name of the table to load in the list control. |
viewId |
String | (Optional) The ID of the view to load. If you don't specify it, navigates to the default main view for the table. |
viewType |
String | (Optional) Type of view to load. Specify savedquery or userquery . |
The entity record object contains the following values.
Name | Type | Description |
---|---|---|
pageType |
String | Specify entityrecord . |
entityName |
String | Logical name of the table to display the form for. |
entityId |
String | (Optional) ID of the table record to display the form for. If you don't specify this value, the form will be opened in create mode. |
createFromEntity |
Lookup | (Optional) Designates a record that will provide default values based on mapped column values. The lookup object has the following String properties: entityType, id, and name (optional). |
data |
Object | (Optional) A dictionary object that passes extra parameters to the form. The parameters can be table columns with default values that are set on new forms (see Set column values using parameters passed to a form), or custom parameters that are accessed on the form using |
formId |
String | (Optional) ID of the form instance to be displayed. |
isCrossEntityNavigate |
Boolean | (Optional) Indicates whether the form is navigated to from a different table using cross-table business process flow. |
isOfflineSyncError |
Boolean | (Optional) Indicates whether there are any offline sync errors. |
processId |
String | (Optional) ID of the business process to be displayed on the form. |
processInstanceId |
String | (Optional) ID of the business process instance to be displayed on the form. |
relationship |
Object | (Optional) Define a relationship object to display the related records on the form. See relationship. |
selectedStageId |
String | (Optional) ID of the selected stage in business process instance. |
tabName |
String | (Optional) Sets the focus on the tab of the form. |
The relationship object, used in the Entity record, contains the following values.
Name | Type | Description |
---|---|---|
attributeName |
String | Name of the column used for relationship. |
name |
String | Name of the relationship. |
navigationPropertyName |
String | Name of the navigation property for this relationship. |
relationshipType |
Number | Relationship type. Specify one of the following values: 0:OneToMany, 1:ManyToMany. |
roleType |
Number | Role type in relationship. Specify one of the following values: 1:Referencing, 2:AssociationEntity. |
The dashboard object contains the following values.
Name | Type | Description |
---|---|---|
pageType |
String | Specify dashboard . |
dashboardId |
String | The ID of the dashboard to load. If you don't specify the ID, navigates to the default dashboard. |
The HTML web resource object contains the following values.
Name | Type | Description |
---|---|---|
pageType |
String | Specify webresource . |
webresourceName |
String | The name of the web resource to load. |
data |
String | (Optional) The data to pass to the web resource. |
The Custom page object contains the following values.
Name | Type | Description |
---|---|---|
pageType |
String | Specify custom . |
name |
String | The logical name of the custom page to open. |
entityName |
String | (Optional) The logical name of the table to be made available in the custom page via Param("entityName") . |
recordId |
String | (Optional) ID of the table record to be made available in the custom page via Param("recordId") . |
The navigationOptions object contains the following values.
Name | Type | Description |
---|---|---|
target |
Number | Specify 1 to open the page inline; 2 to open the page in a dialog.Also, rest of the values (width, height, and position) are valid only if you have specified 2 in this value (open page in a dialog). Note: Entity lists can only be opened inline; entity records and web resources can be opened either inline or in a dialog. |
width |
Number or Object | (Optional) 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 SizeValue with the following properties: - value : The numerical value of type Number.- unit : The unit of measurement of type String. Specify % or px . Default value is px . |
height |
Number or Object | (Optional) 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 SizeValue with the following properties: - value: The numerical value of type Number. - unit: The unit of measurement of type String. Specify % or px . Default value is px . |
position |
Number | (Optional) Specify 1 to open the dialog in center; 2 to open the dialog on the far side. Default is 1 (center). |
title |
String | (Optional) The dialog title on top of the center or side dialog. |
Returns a promise. The value passed when the promise resolves is dependent on the target:
inline: Promise resolves right away, and does not return any value.
dialog: Promise resolves when the dialog is closed. An object is passed only if the pageType
= entityRecord
and you opened the form in create mode. The object has a savedEntityReference
array with the following properties to identify the table record created:
var pageInput = {
pageType: "entitylist",
entityName: "account"
};
Xrm.Navigation.navigateTo(pageInput).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
var pageInput = {
pageType: "entityrecord",
entityName: "account",
entityId: "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" //replace with actual ID
};
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
var pageInput = {
pageType: "entityrecord",
entityName: "account"
};
var navigationOptions = {
target: 2,
height: {value: 80, unit:"%"},
width: {value: 70, unit:"%"},
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success(result) {
console.log("Record created with ID: " + result.savedEntityReference[0].id +
" Name: " + result.savedEntityReference[0].name)
// Handle dialog closed
},
function error() {
// Handle errors
}
);
var pageInput = {
pageType: "webresource",
webresourceName: "new_sample_webresource.htm"
};
var navigationOptions = {
target: 2,
width: 500, // value specified in pixel
height: 400, // value specified in pixel
position: 1
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success() {
// Run code on success
},
function error() {
// Handle errors
}
);
Xrm.Navigation
Navigating to and from a custom page (preview)
Tapahtumat
14. helmik. klo 16 - 31. maalisk. klo 16
Kun sinulla on neljä mahdollisuutta osallistua, voit voittaa konferenssipaketin ja päästä LIVE Grand Finaleen Las Vegasissa
Lisätietoja