Skip to Content
0

How to show a modal dialog box to attach a file in SAP B1 9.2 PL04 Web Browser Access?

Dec 06, 2016 at 07:14 AM

220

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Pedro Magueija Dec 06, 2016 at 01:13 PM
0

Hi,

The normal dialog doesn't work in browser access. You can use SBO_Application.GetFileFromBrowser() to send a file to the server.

Note that GetFileFromBrowser should be used only when in Browser mode. You can use the ClientType property to check.

Pedro Magueija

LinkedIn | Twitter | Blog

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Does this function SBO_Application.GetFileFromBrowser() save file to a shared folder on server?

0

Hi Hüseyin,

As per the documentation:

"Triggers the Web browser to upload a file to the server. After the file is uploaded, returns the full path of the file that is saved on the server."

Pedro Magueija

LinkedIn | Twitter | Blog

0