AL icon indicating copy to clipboard operation
AL copied to clipboard

DotNet runonclient

Open JoelJame5 opened this issue 8 years ago • 5 comments

Does runonclient dotnet work? I built an internally targeted project and I get the following error on windows client calling OpenFileDialog.ShowDialog. image

assembly(System.Windows.Forms) { type(System.Windows.Forms.OpenFileDialog; OpenFileDialog){} type(System.Windows.Forms.DialogResult; DialogResult){} }

Declared the variables as follows: OpenFileDialog: DotNet OpenFileDialog runonclient; DialogResult: DotNet DialogResult runonclient;

When I debug I can see the following difference in the variable. COD419.OpenFileDialog() image

My AL Project image

JoelJame5 avatar Jul 26 '18 08:07 JoelJame5

Taking a step back, I'm not too sure what the use-case is for supporting a native .NET OpenFileDialog. What's wrong with FileMgt.OpenFileDialog?

Perhaps the dotnet interop in AL runs in a non-user interactive mode?

XVII avatar Jul 26 '18 12:07 XVII

To select multiple files, with Multiselect enabled on OpenFileDialog.

JoelJame5 avatar Jul 26 '18 12:07 JoelJame5

I've had this use case before too. I ended up using a control add-in (web based) to accept multiple files. Or, make it a browse folder dialog.

Probably a better long term investment then trying to use dotnet, especially in a BC web environment.

XVII avatar Jul 26 '18 22:07 XVII

It is a compiler bug - we haven't removed the old, invalid syntax for using client side .NET.

If you change your code to:

[RunOnClient]
OpenFileDialog: DotNet OpenFileDialog;
[RunOnClient]
DialogResult: DotNet DialogResult;

it will show the file dialog as expected.

StanislawStempin avatar Nov 01 '18 15:11 StanislawStempin

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 25778.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/

ALGitHubBot avatar Dec 12 '18 12:12 ALGitHubBot