Skip to content

Commit ed01f13

Browse files
author
skovlund
committed
Fixed typings for setCurrentView and getCurrentView on the ViewSelector
1 parent 8f7cd1e commit ed01f13

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • src/XrmDefinitelyTyped/Resources

src/XrmDefinitelyTyped/Resources/xrm.d.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,20 @@
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+
558+
/**
559+
* Interface for a view type reference reference for the view selector
560+
*/
561+
interface ViewReference {
562+
entityType: ViewTypeNumber;
563+
id: string;
564+
name?: string | null;
565+
}
566+
553567
/**
554568
* Remarks:
555569
* 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 +572,7 @@
558572
/**
559573
* Use this method to get a reference to the current view.
560574
*/
561-
getCurrentView(): Xrm.EntityReference<string>;
575+
getCurrentView(): Xrm.ViewReference;
562576

563577
/**
564578
* Use this method to determine whether the view selector is visible.
@@ -568,7 +582,7 @@
568582
/**
569583
* Use this method to set the current view.
570584
*/
571-
setCurrentView(reference: Xrm.EntityReference<string>): void;
585+
setCurrentView(reference: Xrm.ViewReference): void;
572586
}
573587

574588
/**

0 commit comments

Comments
 (0)