Browser Access Add-On Compatibility Guide

Size: px
Start display at page:

Download "Browser Access Add-On Compatibility Guide"


1 How-to Guide SAP Business One Cloud Browser Access Document Version:

2 Typographic Conventions Type Style Example Example EXAMPLE Example Example <Example> EXAMPLE Description Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Textual cross-references to other documents. Emphasized words or expressions. Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. Keys on the keyboard, for example, F2 or ENTER. 2 rights reserved. Typographic Conventions

3 Document History Version Date Change Initial version. Document History rights reserved. 3

4 Table of Contents 1 Purpose New SDK Features New Interfaces in UI API ClientType Property File Upload/Download API New Flag in the Extension Package Tool: Supported Client Type Flag Compatibility List Sample Code Uploading and Downloading Files rights reserved. Table of Contents

5 1 Purpose This document provides information to help you to understand the browser access operating mode relating to add-ons. The document describes new features and lists existing features affected by the new mode. Using the information contained herein, you will be able to assess any potential impacts on your current add-on code, and understand how you can mitigate any impact. Purpose rights reserved. 5

6 2 New SDK Features SAP provides you with new SDK features to help you to make any necessary adaptions for Browser Access mode. 2.1 New Interfaces in UI API ClientType Property In UI API, a new propertyclienttype has been added to theapplication object. This property identifies if the SAP Business One client is operating in Windows desktop mode or Browser Access mode. You can use this property in your add-on code to create conditional logic targeted only at one of the two different modes. ClientType Property Description Property type Syntax Example Identifies if the SAP Business One client is operating in Windows desktop mode or Browser Access mode. Read-only property Public Property ClientType () As BoClientType if (SBO_Application.ClientType == BoClientType.ct_Browser) //code runs in the Browser Access mode if (SBO_Application.ClientType == BoClientType.ct_Desktop) //code runs in the Windows desktop mode BoClientType Enumeration Members Member Value Description ct_desktop 0 The SAP Business One client is operating in Windows desktop mode. ct_browser 1 The SAP Business One client is operating in Browser Access mode. 6 rights reserved. New SDK Features

7 2.1.2 File Upload/Download API The Windows native open and save dialog boxes are not supported in Browser Access mode. In order to support add-ons that have file open/save functionality, SAP provides two new methods available for Browser Access mode. In UI API, the new methodsgetfilefrombrowser andsendfiletobrowser have been added to the Application object. GetFileFromBrowser Method Description Syntax Example 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 in the server. Public Function GetFileFromBrowser() As String String filepath = SBO_Application.GetFileFromBrowser() SendFileToBrowser Method Description Syntax Parameters Example Sends a file that is stored in the server to a Web browser. Public Function SendFileToBrowser( _ ByVal filename As String _ ) As Boolean filename: Full path of the file. Bool result = SBO_Application.SendFileToBrowser(filePath) Note You can use the ClientType Property (defined in 2.1.1) to call these functions in Browser Access mode only. These functions are not supported in Windows desktop mode, and if called, an exception will be thrown. See sample code in section 4.1 Uploading and Downloading Files. 2.2 New Flag in the Extension Package Tool: Supported Client Type Flag SAP now provides the Supported Client Type flag for add-on developers to specify in which modes the add-on can operate. This allows the developer to restrict the add-on from running in a non-compatible mode. The flag is set when the developer packages the add-on in the Extension Package Tool. The new field Supported Client Type is provided on the Basic Information tab of the Extension Package tool,. New SDK Features rights reserved. 7

8 Option Description Rules Desktop Browser Both Default value, add-ons/ extensions can work in Windows desktop only Add-ons/extensions can work in Browser Access mode only. Add-ons/extensions can work on both client types. Applies to the SAP Business One client application in the Windows desktop mode. If you have not yet repackaged your add-ons using this Extension Package tool with the new Supported Client Type field, your existing add-ons/extensions are compatible with the Desktop type. To run your add-ons/extensions in Browser Access mode only, you must package your add-ons/ extensions with the Browser type. To run your existing add-ons/extensions on both client types, you must package your add-ons/ extensions with the Both type. You can set the Supported Client Type field according to your own add-on strategy. You may design your add-on to run in Windows desktop mode and in Browser Access mode (using the Both type). Also, you may create two versions, one for Windows desktop mode (using the Desktop type), and another for Browser Access mode (using the Browser type). For general information about the Extension Package tool, see How to Package and Deploy SAP Business One Extensions for Lightweight Deployment. 8 rights reserved. New SDK Features

9 Note Add-on packages created with an older Extension Package tool do not have this Supported Client Type flag. If this type of add-on package is installed into a Browser Access enabled SAP Business One environment, then this flag will default to Desktop. If you wish to override this flag manually in the customer environment, you could change the database value directly. For the new flag Supported Client Type, a new fieldclienttype was added into the following database tables: o SARI - add-ons table for the on-premise environment, in databasesbo-common o Extensions- extensions table for the cloud environment, in databasesldmodel.slddata Details of the newclienttype field: Field Type Size Default Value Constraints ClientType VarChar 1 W W Windows desktop mode only B A Browser Access mode only All client types SBOScript is one such add-on that you may want to enable manually immediately after upgrading to the Browser Access enabled version of SAP Business One. Change the value of theclienttype field to "A" in theextensions table of thesldmodel.slddata database. New SDK Features rights reserved. 9

10 3 Compatibility List The technical differences between a Windows based and a browser based UI environment caused impacts on certain SDK features. The table below lists the known affected items, along with a recommendation on dealing with the impact. These items are affected only when you are operating the SAP Business One Client in Browser Access mode. When operating in Windows desktop mode these items are not affected. We recommend that you review the list to determine if any items affect your add-on. # Item Recommendation 1 SAP Business One Studio Suite is not supported in Browser Access mode; relevant menus are disabled: Tools -> SAP Business One Studio Suite. 2 Traditional add-on installation (whereby add-ons are automatically installed when you open the SAP Business One client) is not supported. 3 Previewing and Printing are not supported for user-defined object (UDO) forms. Use SAP Business One Studio Suite in Windows desktop mode. You can install the add-on in SAP Business One Windows desktop mode, and then use it in Browser Access mode. Preview and print the UDO forms in SAP Business One Windows desktop mode. 4 Importing UDO implementation DLL is not supported. Import the DLL in SAP Business One Windows desktop mode. 5 Add-ons with Windows native objects are not supported. Calls to Windows native objects should be avoided in Browser Access mode using conditional logic. Refer to Note 1. 6 UI API: The following Item Events are not supported: Button: et_key_down ButtonCombo:et_KEY_DOWN CheckBox: et_double_click;et_key_down EditText: et_click;et_double_click Form: et_print_layout_key;et_click;et_drag OptionBtn: et_double_click;et_key_down Rectangle: et_click;et_double_click. Also note that in browser access mode certain events may be triggered in a different sequence and at slightly different times compared to Windows desktop mode. In Browser Access mode, any code attached to these events will not be executed. If your add-on has logic attached to these events, then depending on your specific use case, you may move your logic to an event prior to or after these missing events. Refer to Note 1. 7 UI API: ActiveX object is not supported. Refer to Note rights reserved. Compatibility List

11 # Item Recommendation 8 UI API: Compatibility issues with the Application object: Methods:Application.SendKeys is not supported. Properties: o Application.Desktop, which represents the SAP Business One application desktop in UIAPI, is not supported. Changing the width and height of the SAP Business One desktop application will not be valid in Browser Access mode. Refer to Note 1. o Application.FontHeight and Application.FontName are not supported. 9 UI API: Compatibility issues with the Form object: Methods:Form.Freeze is not supported. Properties: o Thefbs_Floating form border style is not supported. Refer to Note 1. o Setting the position of a form is not supported. Form.Left does not work. 10 UI API: Compatibility issues with the Item object: Items font, color, wallpaper, background related functions are not supported.item.forecolor,item.backcolor, and Item.Fontsize do not work. Refer to Note 1. Displaying item description in the SAP Business One status bar is not supported.item.description does not work. The description of valid values is not supported. Item.DisplayDesc does not work. 11 UI API: Compatibility issues with matrix and grids: Matrix cannot display pictures. ColumnSetting.DisplayType = SAPbouiCOM.BoColumnDisplayType.cdt_Picture does not work. Refer to Note 1. Matrix and Grid font change is not supported. CommonSetting.GetCellFontSize,GetCellFontStyle, SetCellFontSize, SetCellFontStyle, SetRowFontSize, and SetRowFontStyle do not work. Change the color of a separate line (a line between rows) is not supported.commomsetting.separateline border color does not work. Freezing a column in a grid or a matrix is not supported. CommomSetting.FixedColumnsCount does not work Displaying column description in the SAP Business One status bar is not supported.column.description does not work. 12 In the aet_shutdown event and the et_form_deactivate event, the SAP Business One message box is not supported. Add-ons should not call the message box in these events for Browser Compatibility List rights reserved. 11

12 # Item Recommendation Access mode. Refer to Note UI API: Old Cockpit related objects are not supported: Cockpit; Cockpits; Widget; WidgetData; WidgetRegParams; Widgets; WidgetEvent; WebBrowser Old cockpit is not supported in Browser Access mode; thus the relevant APIs are not supported. Refer to Note UI API: the WebBrowser object is not supported. Refer to Note UI API: Modal form is not supported. The code in the UI API sample #12 ModalForm does not work in Browser Access mode. Refer to Note 1. Note 1 Use the ClientType Property (defined in 2.1.1) to define conditional logic for the different modes. Also see Sample Code in section rights reserved. Compatibility List

13 4 Sample Code 4.1 Uploading and Downloading Files if (SBO_Application.ClientType == BoClientType.ct_Browser) string path = null; try path = SBO_Application.GetFileFromBrowser(); using (FileStream fs = File.Open(path, FileMode.Open)) //read the file catch (Exception ex) //exception handling try bool issucceed = SBO_Application.SendFileToBrowser(path); catch (Exception ex) //exception handling else if(sbo_application.clienttype == BoClientType.ct_Desktop) System.IO.Stream readstream = null; OpenFileDialog openfiledialog1 = new OpenFileDialog(); if (openfiledialog1.showdialog() == DialogResult.OK) try Sample Code rights reserved. 13

14 if ((readstream = openfiledialog1.openfile())!= null) using (readstream) //read the file catch (Exception ex) //exception handling SaveFileDialog savefiledialog1 = new SaveFileDialog(); System.IO.Stream writestream = null; if (savefiledialog1.showdialog() == DialogResult.OK) try if ((writestream = savefiledialog1.openfile())!= null) using (writestream) //write the file catch (Exception ex) //exception handling 14 rights reserved. Sample Code


16 Copyrights, Trademarks, and Disclaimers rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies. Please see for additional trademark information and notices. Please see for third party trademark notices. Please see for important disclaimers and legal information. JAVATM DISCLAIMER Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressly prohibited, as is any decompilation of these components. Any Java Source Code delivered with this product is only to be used by SAP s Support Services and may not be modified or altered in any way. SAP BUSINESS ONE ADDITIONAL COPYRIGHTS & TRADEMARKS DotNetZip,.NET, SQL Server, Visual C++, Visual #, and Windows Installer are registered trademarks of Microsoft Corporation. DynaPDF is a trademark of DynaForms Software for Documents - Jens Boschulte. EDTFTPJ/PRO is a trademark of Enterprise Distributed Technologies. InstallAnywhere and InstallShield are trademarks of Flexera Software LLC. SEE4C (SMTP/POP3 Engine Library for C/C++) is the copyright of MarshallSoft Computing, Inc. Victor Image Processing Library and VIC32 are trademarks of Catenary Systems. The Victor Image Processing Library is copyright material. This includes the source code, object code, dlls, examples, and documentation. This material is protected by United States copyright law as well as international copyright treaty provisions.