Skip to content

Commit 7477b8d

Browse files
authored
Merge pull request #261 from delegateas/258_view_selector_typings
Fixed typings for setCurrentView and getCurrentView on the ViewSelector
2 parents 152e697 + ae96c67 commit 7477b8d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • src/XrmDefinitelyTyped/Resources

src/XrmDefinitelyTyped/Resources/xrm.d.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/**
5454
* Interface for an entity reference for the Xrm.Page context.
5555
*/
56-
interface EntityReference<T extends string> {
56+
interface EntityReference<T extends string|number> {
5757
id: string;
5858
entityType: T;
5959
name?: string | null;
@@ -550,6 +550,11 @@
550550
*/
551551
type AnyControl = BaseControl & Partial<Control<any> & WebResourceControl & IFrameControl & LookupControl<string> & SubGridControl<string> & DateControl & OptionSetControl<any>>;
552552

553+
const enum ViewTypeNumber {
554+
SavedQuery = 1039,
555+
UserQuery = 4230,
556+
}
557+
553558
/**
554559
* Remarks:
555560
* If the subgrid control is not configured to display the view selector, calling this method on the ViewSelector returned by the GridControl.getViewSelector will throw an error.
@@ -558,7 +563,7 @@
558563
/**
559564
* Use this method to get a reference to the current view.
560565
*/
561-
getCurrentView(): Xrm.EntityReference<string>;
566+
getCurrentView(): EntityReference<ViewTypeNumber>;
562567

563568
/**
564569
* Use this method to determine whether the view selector is visible.
@@ -568,7 +573,7 @@
568573
/**
569574
* Use this method to set the current view.
570575
*/
571-
setCurrentView(reference: Xrm.EntityReference<string>): void;
576+
setCurrentView(reference: EntityReference<ViewTypeNumber>): void;
572577
}
573578

574579
/**

0 commit comments

Comments
 (0)