Skip to content

Commit ae96c67

Browse files
committed
Update to typings for setCurrentView and getCurrentView so we do not recreate the EntityReference, but instead let it extend from number as well.
1 parent ed01f13 commit ae96c67

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

  • src/XrmDefinitelyTyped/Resources

src/XrmDefinitelyTyped/Resources/xrm.d.ts

Lines changed: 3 additions & 12 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;
@@ -555,15 +555,6 @@
555555
UserQuery = 4230,
556556
}
557557

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-
567558
/**
568559
* Remarks:
569560
* 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.
@@ -572,7 +563,7 @@
572563
/**
573564
* Use this method to get a reference to the current view.
574565
*/
575-
getCurrentView(): Xrm.ViewReference;
566+
getCurrentView(): EntityReference<ViewTypeNumber>;
576567

577568
/**
578569
* Use this method to determine whether the view selector is visible.
@@ -582,7 +573,7 @@
582573
/**
583574
* Use this method to set the current view.
584575
*/
585-
setCurrentView(reference: Xrm.ViewReference): void;
576+
setCurrentView(reference: EntityReference<ViewTypeNumber>): void;
586577
}
587578

588579
/**

0 commit comments

Comments
 (0)