Previous Topic

Book Contents

Book Index

Next Topic

Login Syntax

The following section of the code performs the login into Valuemation and gets the main "Application” object from the database. In the following examples in this guide we will always assume that you have logged in correctly, therefore, you should adapt the following code to your needs and use it as a header for each example we will mention in this guide.

Example - Section of the login code

‘gets the entry object

Set oLogin=getObject("S3:de.usu.s3.api.ApiLogin") ‘(1)

Set oCollection=oLogin.login("UserName","UserPassword")

Set oClient=oCollection.item(ClientNumber) ‘(2)

Set oVM=oLogin.login("UserName","UserPassword",oClient) ‘(3)

Optionally, you can include a message confirming a successful login

WScript.echo "Logging into client"_

&oClient.getBOFields.find("clientId").getDisplayValue&"_ "&oClient.getBOFields.find("description").getDisplayValue

MsgBox "Login successful."

To explain, getObject is a standard way to get a COM object. As far as the string in the brackets is concerned, S3 stands for a name of a COM server as set in J-Integra, it is used for registration of JVM (Java Virtual Machine). This server waits for a call on a specified port and it is a standard way to run applications written in Java.

The other part of the string behind the colon is a name of the Java class that should be run subsequently, in our case it is the ApiLogin class (see Logging In) that allows you to verify your login and provides method login that we call in the next step.

See Also

Logging into Valuemation

Logging In

Initialize login through GUI

Logging Out

Domains