12-06-2016 7:14 AM - edited 02-03-2024 5:28 PM
Dear Experts,
I am using SAP B1 version 9.2 PL04, I have a requirement to attach a file to UDO form, I am trying to open windows dialog to select a file using the following code segment; it is working fine in debugging and tracing mode and when creating an add-on for this; it is working fine on SAP B1 client, but when try to use SAP B1 9.2 PL04 web browser access; it is not working, the dialog is not open and I got the following message in the status bar:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
-------------------------------
Code Segment
OpenFileDialog openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
NativeWindow nw = new NativeWindow();
string ProcessServiceName = "SAP Business One";
nw.AssignHandle(System.Diagnostics.Process.GetProcessesByName(ProcessServiceName)[0].MainWindowHandle);
Global.StatusBar("wrn", "If 'Open File Dialog' is not shown,
press Alt + Tab");
DialogResult result = openFileDialog1.ShowDialog(nw);
--------------------------------
Your quick answer is highly appreciated.
Thanks & Regards
Samer Shuqair
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.