📚 SAP Business One SDK Help

Application Object Members
See Also  Overview 

Public Methods

Public Method ActivateMenuItemSimulates a user click on a menu item.
Public Method ActivateToolbarSimulates a user click on a toolbar icon.
Public Method CreateObjectCreates an object of the specified type.

Use this method to create forms, menus, or conditions for DBDataSource.Query.

Public Method ExportRptAsXMLReturns an XML string representation of the report.
Public Method GetFileFromBrowserTriggers 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 Method GetFilterReturns the current event filter on the Application object.
Public Method GetFormItemDefaultHeightReturns the default height of the item.
Public Method GetFormItemDefaultWidthReturns the default width of the item.
Public Method GetLastBatchResultsReturns a string indicating the results (errors or warnings) of the last call to the LoadBatchActions method.
Public Method LoadBatchActionsLoads XML in order to create forms, items, menus, and matrix columns in a single API call.

Define the forms, items, menus, and matrix columns by created an XML file based on the schema described in Adding Forms with XML.

Public Method MessageBoxSends a modal message box to the SAP Business One application.
Public Method OpenFormOpens an SAP Business One system form or a user-defined object (UDO) form.
Public Method RemoveWindowsMessageThis method enables you to deal with extreme scenarios. When an add-on needs to take a long time to process a UI API event, it prevents SAP Business One from processing the Windows message queue. Consequently, the message queue overflows, and if the add-on performs any other call back to SAP Business One via COM, it causes a system RPC failure.
Public Method SendFileToBrowserSends a file that is stored in the server to a Web browser.
Public Method SendKeysSimulates a user pressing one or more keys in the active form.
Public Method Serialize Serialize
Public Method ServerInvokemethod ServerInvoke
Public Method SetFilterSets an event filter for a specific form.
Public Method SetStatusBarMessageDeprecated in UI API 2004.
The method is supported in the next two releases for backward compatibility. Instead, use Application. StatusBar to get a status bar object, and then call StatusBar.SetText.

Public Properties

Public Property AppIdThe application ID.
Public Property ClientTypeIdentifies if the SAP Business One client is operating in Windows desktop mode or Browser
Access mode.
Public Property CockpitsCockpits object that represents the cockpits in the application.
Public Property CompanyA Company object that represents the company database to which the SAP Business One application is connected.
Public Property DesktopDesktop object representing the SAP Business One application desktop.
Public Property EventLevelIndicates the level of UI event (such as click or form load) takes place.
Public Property FocusRestoredIndicates whether the focus is restored.
Public Property FontHeightThe current font height which the SAP Business One client uses.
Public Property FontNameThe current font name which the SAP Business One client uses.
Public Property FormsA collection of the forms that have been opened in the SAP Business One application.

Access a specific form by supplying one of the following:

  • By FormUID (internal form ID supplied as a parameter in the ItemEvent event method and in the several event objects, such as ItemEvent)
  • By index (the position with this collection, 0-based)
  • By form type and instance count

Use the Forms.Item method when supplying a FormUID or index. Use the Forms.GetForm method when supplying a type and instance count.

Public Property IsHostedEnvironmentIndicates whether the application is a hosted environment or not.
Public Property LanguageThe user interface language of the SAP Business One application.
Public Property MenusA collection of the current menu items in the SAP Business One menu tree.

Use the Menus collection to access a menu item:

  • By unique ID
  • By index (0-based)

You can directly access any menu item in the application's menu tree by using its unique ID, or you can traverse the menu tree by using an index at each level, which returns the menu item at a specified position in the current level. This property (Application.Menus) returns the top-level menu items.

Public Property MetadataAutoRefreshIndicates whether the auto-refresh mechanism in the SAP Business One application is active. The default is true.
Public Property ResourceDataResource information about system forms and items.
Public Property SkinStyleIndicates the skin for the SAP Business One user interface.
Public Property StatusBarStatusBar object that represents the application status bar. Use this object to:
  • Set a status bar message
  • Create a progress bar
Public Property XSEngineBaseURLReturns the XS Engine base URL in SAP HANA enabled landscape.

In non-SAP HANA enabled landscape, the return value is an empty string.

Events

Public Event AppEventOccurs when one of the following changes takes place in the SAP Business One application:
  • Application shutdown
  • Company database was changed
  • Interface language was changed
  • UI server shutdown
Public Event FormDataEventOccurs when the application performs the following actions on forms connected to business objects:
  • Add
  • Update
  • Delete
  • Load form data via browse, link button, or find

The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. Use this as an input object to the DI API DataBrowser.GetByKeys method to get a DI object.

Note: You can also use this feature in the UDO new default forms with the header-line style.

Public Event ItemEventOccurs when a UI event (such as click or form load) takes place on a form in the SAP Business One application.
Public Event LayoutKeyEventOccurs when you print or print preview a layout of an add-on form.

When the layout needs the key of the add-on form, the add-on catches and sets LayoutKeyInfo.LayoutKey to the key.

Public Event MenuEventOccurs when a UI event (click) takes place on menu item in the SAP Business One application. 
Public Event PrintEventOccurs when one of the following takes place:
  • End user clicks on Print or Print Preview icons.
  • End user sends documents to print using the Document Printing option.
  • A document is sent to print by the Document Generation Wizard.
Public Event ProgressBarEventOccurs when a progress bar is created, stopped, or released in the status bar of the application.
Public Event ReportDataEventOccurs when a report is sent to the printer.
Public Event RightClickEventOccurs when an end user clicks the right mouse button on a form.

Use this event to create a right-click menu for your add-on forms, or to modify the right-click menu for system forms. 

Public Event ServerInvokeCompletedEventmethod ServerInvokeCompletedEvent
Public Event StatusBarEventOccurs when a message is created in the application status bar.

Use the StatusBar object to display messages.

Public Event UDOEventOccurs when you open a UDO default form with the header-line style.
Public Event WidgetEventOccurs when a widget instance is created (dragged into the cockpit or created by the CreateWidgetInstance method of the Cockpit object).

See Also