delegateas / XrmDefinitelyTyped

Tool to generate TypeScript declaration files for Dynamics 365/CDS client-side coding.
http://delegateas.github.io/Delegate.XrmDefinitelyTyped/
MIT License
133 stars 53 forks source link

Xrm.Navigation.openFile has inncorect type for openFileOptions #302

Closed matejskubic closed 6 months ago

matejskubic commented 7 months ago

Describe the bug As per documentation of the openFile has a parameter openFileOptions. This type must have a property named openMode.

The current implementation has openFileOptions defined as enum - this must be an interface with property openMode with such enum.

To Reproduce Steps to reproduce the behavior:

await Xrm.Navigation.openFile(fileOptions, Xrm.OpenFileOptions.Save);

Actual behavior The file is not saved. Error message: This attachment can not be opened on your device.

Expected behavior The file should be saved.

await Xrm.Navigation.openFile(fileOptions, { openMode: Xrm.OpenFileOptions.Save });

image

Environment

Additional context

https://github.com/delegateas/XrmDefinitelyTyped/blob/dcdcdc0e6efc2f8f22433631008e39c0af0b095e/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts#L638

https://github.com/delegateas/XrmDefinitelyTyped/blob/dcdcdc0e6efc2f8f22433631008e39c0af0b095e/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts#L249

matejskubic commented 7 months ago

Opened a discussion at https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/68991