diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index a1690e0122..df0db06292 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -4423,12 +4423,83 @@ declare namespace Xrm { */ roleType?: XrmEnum.RoleType; } + + interface PageInputEntityList { + pageType: "entitylist"; + /** + * The logical name of the entity to load in the list control. + * */ + entityName: string; + /** + * The ID of the view to load. If you don't specify it, navigates to the default main view for the entity. + * */ + viewId?: string; + /** + * Type of view to load. Specify "savedquery" or "userquery". + * */ + viewType?: "savedquery" |"userquery"; + } + + interface PageInputHtmlWebResource { + pageType: "webresource"; + /** + * The name of the web resource to load. + * */ + webresourceName: string; + /** + * The data to pass to the web resource. + * */ + data?: string; + } + + /** + * 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. + * */ + interface NavigationOptions { + /** + * Specify 1 to open the page inline; 2 to open the page in a dialog. + * Entity lists can only be opened inline; web resources can be opened either inline or in a dialog. + * */ + target: 1 | 2; + /** + * 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 + * */ + width?: number | NavigationOptions.SizeValue; + /** + * 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 + * */ + height?: number | NavigationOptions.SizeValue; + /** + * Specify 1 to open the dialog in center; 2 to open the dialog on the side. Default is 1 (center). + * */ + position?: 1 | 2; + } + + namespace NavigationOptions { + interface SizeValue { + /** + * The numerical value + * */ + value: number; + /** + * The unit of measurement. Specify "%" or "px". Default value is "px" + * */ + unit: "%" | "px"; + } + } } /** * Interface for the Xrm.Navigation API */ interface Navigation { + /** + * Navigates to the specified page. + * @param pageInput Input about the page to navigate to. The object definition changes depending on the type of page to navigate to: entity list or HTML web resource. + * @param navigationOptions 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. + */ + navigateTo(pageInput: Navigation.PageInputEntityList | Navigation.PageInputHtmlWebResource, navigationOptions?: Navigation.NavigationOptions): Async.PromiseLike; + /** * Displays an alert dialog containing a message and a button. * @param alertStrings The strings to be used in the alert dialog.