delegateas/XrmDefinitelyTyped

Typings for setCurrentView

skovlund opened this issue · 1 comments

Describe the bug
Typings for viewSelector.setCurrentView(object); assume the parameter 'object' is of type EntityReference<string>.
This typing forces the entityType part of the object to be string, but it should be a number.

To Reproduce
Steps to reproduce the behavior:

  1. Generate typings for a form with a subgrid, where the viewselector is enabled
  2. Add formscripting that uses viewSelector.setCurrentView(object);

Expected behavior
Typings that match the documentation i.e., entityType is a number and not a string.

Screenshots
image

Environment

  • XrmDefinitelyTyped v. 5.4.2

Note: It's not any number, it's the object type code for either SavedQuery (1039) or UserQuery (4230).
This should probably be generated as a const enum and compile-time replaced with the respective number.
image