📚 SAP Business One SDK Help

GetAppIdFromProcessId Method
See Also  Example
ProcessId

The process ID that you can get from Microsoft Windows API.

If there is only one SAP Business One process running, you can use -1 or empty value.

Description

Gets the application ID by the SAP Business One process ID if there are many SAP Business One processes running at the same time.

Syntax

Visual Basic
Public Function GetAppIdFromProcessId( _
   ByVal ProcessId As Long _
) As Long

Parameters

ProcessId

The process ID that you can get from Microsoft Windows API.

If there is only one SAP Business One process running, you can use -1 or empty value.

Example

Getting Application ID from Windows Process ID (C#)Copy Code
SAPbouiCOM.SboGuiApi SboGuiApi = new SAPbouiCOM.SboGuiApi(); 
SboGuiApi.Connect("0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D005600490049005611"); 
long appId = SboGuiApi.GetAppIdFromProcessId(processId); 
SAPbouiCOM.Application mSBO_Application = SboGuiApi.GetApplication(appId); 

See Also