Description
Application Object
Before you can use the Integration Server, you have to create an Application object. The Application object is the central portal for Integration Server functionality. First of all, add a reference to the Integration Server API in the Visual Basic project. Select the "ERPLink 4.5 Library" on the COM tab of the References in the project settings. You can now use functionality of the Integration Server API.
Use the code below to create the Application object. By placing the object in a global variable you can use the object in other functions.
Dim oERPLink As IERPLink.Application
Set oERPLink = new IERPLink.Application
By creating an Application object an Integration Server object will be created and also there will be a check for licenses for both the applications.
Note: You can create a large number of objects from the Application object using methods. For example, with the CreateDataForm method you can create a form object.
Database Connection
Almost all Isah Integration functionality makes use of the Isah database and therefore an active database connection is required. The user must be logged in (in Isah and the database) to determine his rights. The Connection object of the Integration should be used for logging in. The login can be performed with or without a login form: either the login data can be entered in advance (for example in case of automated processes such as updating all document statuses from a Document Management System) or entered by the user. You can find an example of both situations below. When the login data are correct and valid the database connection will be established.
Logging in Without a Login Form
oERPLink = New IERPLink.Application
oERPLink.Connection.DatabaseAliasname = "DemoDB"
oERPLink.Connection.Username = "Guest"
oERPLink.Connection.Password = ""
oERPLink.Connection.ShowLoginDialog = False
oERPLink.Connect()
Logging in With a Login Form
oERPLink = New IERPLink.Application
oERPLink.Connect()
The default value for ShowLoginDialog is TRUE, so in the example above the login form will be showed in which the user can enter Administration, Name and Password. When the user clicks the OK button, the database connection will be created. You can check this by retrieving the Connected property.
If oERPLink.Connected then
MsgBox "Connected with the database."
Else
MsgBox "No connection with the database."
End If
You have to release the Application object when it is no longer needed. If you close the last application that uses the Integration Server, the Integartion Server will be closed automatically.