Support TypeScript to the same level as JavaScript
TypeScript support currently is not as nuanced as JavaScript - OptionSets, Attribute Types, 'getAttribute("fieldname").getValue()' typing does not currently function.
Support TypeScript to the same level as JavaScript:
Xrm.Page.getAttribute("fieldname") auto-typing (i.e. determine what field this is - i.e. OptionSet, so that TypeScript can do Xrm.Page.getAttribute("new_dropdownfield").getOptions() or .getValue())
Xrm.Page.getValue("fieldname").setValue() support.
Currently, if those (and other attribute-specific) functions are used, they are not recognised by TypeScript, meaning Intellisense throws errors constantly as invalid functions or types.

See comment for details.
-
Peter Street (LazerFX) commented
Ah, I see - makes sense, you have to manually expose things. With that, however, I won't get any intellisense for Optionset Values, such that I get with the standard functionality, however?
-
Hi Peter,
This is already supported by first casting the attribute or control to the correct type. For example, to get the value of an optionset you could use the following: (<Xrm.Page.OptionSetAttribute>Xrm.Page.getAttribute("someAttribute")).getValue()
Regards,
Steve