defascat Posted February 15, 2006 Posted February 15, 2006 Hi!While running js file from the file system double-clicking on it everything is OK.When I try to execute this script from the InfoPath I'm getting such an error "Automation server can't create object" on the var ldapEnumeration = GetObject(ldapSearchString);line.e.number returns -2146827859(0x800a01ad). Here's a piece of code:function XDocument::OnLoad(eventObj){ var columnNames = "distinguishedName"; var columnNamesArray = columnNames.split(","); var values = GetData("LDAP://OU=Users,DC=company,DC=com",columnNamesArray);}function GetData(ldapSearchString,columnNamesArray){ try{ var ldapObjectsDataArray = new Array(); var ldapEnumeration = GetObject(ldapSearchString); var ldapObjects = new Enumerator(ldapEnumeration); for(;!ldapObjects.atEnd();ldapObjects.moveNext()) { var ldapObject = ldapObjects.item(); var objectPropertyValues = new Array(); for(var i = 0; i < columnNamesArray.length;i++) { objectPropertyValues.push(ldapObject[columnNamesArray]); } ldapObjectsDataArray.push(objectPropertyValues); } } catch(e) { XDocument.UI.Alert(e.message + "\r\n"+ e.description + "\r\n"+ e.name); XDocument.UI.Alert(e.stack); XDocument.UI.Alert(e.number); }}Does anyone know the solution of this problem?Thank you in advance!P.S. I'm sorry I haven't found a special forum for InfoPath..
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now