This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - connect aras with javascript?

vuanhnam - Thursday, August 20, 2009 4:41 AM:

var innServerURL = "localhost/.../InnovatorServer.aspx";
var dbID = 'MyDB';
var login = 'admin';
var password = 'innovator';
 
var iomFactory = new ActiveXObject("Aras.IOM.IomFactory.8.2");
 
var httpServerConnection = iomFactory.CreateHttpServerConnection(innServerURL, dbID,
login, password);
var loginResult = httpServerConnection.login();
if (loginResult.IsError())
{
  WScript.echo(loginResult.GetErrorDetail());

}
else
{
  var myInnovator = iomFactory.CreateInnovator(httpServerConnection);
  
  var queryItem = myInnovator.newItem();
  queryItem.setType("User");
  queryItem.setAction("get");
  queryItem.setAttribute("select","login_name");
  var resultItem = queryItem.apply();
  if (!resultItem.IsError())
  {
    WScript.echo("Number of users: "+resultItem.getItemCount());
  }
  else
  {
    WScript.echo(resultItem.GetErrorDetail());
  }
  
  httpServerConnection.logout();
}

 

it not work please help me