• Problems with NotesDirectory.NameLookup

    By Uwe E. Jandt 1 decade ago

    Hi XPerts -



    I tried to use the NotesDirectory Class but get the error msg:



    Method NotesDirectory.lookupNames(string, string, Array, boolean) not found, or illegal parameters



    my SSJS code goes like:


    var userinfo = new Array()<br/>
    userinfo[0] = &quot;MailFile&quot;<br/>
    userinfo[1] = &quot;MailServer&quot;<br/>
    userinfo[2] = &quot;InternetAddress&quot;<br/>
    userinfo[3] = &quot;ShortName&quot;<br/>
    userinfo[4] = &quot;EmployeeID&quot;<br/>
    


    var ddir:NotesDirectory = session.getDirectory() <br/>
    ddir.setSearchAllDirectories(false)<br/>
        <br/>
    error --&gt; var ddnav = ddir.lookupNames(&quot;$Users&quot;,@UserName(),userinfo,false)<br/>
    



    doesn't it works with an js array?



    if I write

    var ddnav = ddir.lookupNames(&quot;$Users&quot;,@UserName(),&quot;MailFile&quot;)<br/>
    



    it doesn't throw an error (at this place) …

    … but it stops 2 lines further, at 'ddnav.getNameLocated()':



    ….

    var ddnav = ddir.lookupNames(&quot;$Users&quot;,@UserName(),&quot;MailFile&quot;)<br/>
    var mypos = ddnav.findFirstName()<br/>
    error --&gt; if (ddnav.getNameLocated()) {<br/>
    



    with the msg:

    Error calling method 'getNameLocated()' on an object of type 'lotus.domino.local.DirectoryNavigator [Static Java Interface Wrapper, lotus.domino.local.DirectoryNavigator: lotus.domino.DirectoryNavigator]'



    so isn't the NotesDirectory not really made for use in JS? I found it in designer's help, but the NotesDirectoryNavigator

    is not a proposed domino object in the JS scripting reference.



    I tried the whole code (very close to this) in lotus script, there it works without a problem.



    Thanks for any help - and sorry for my "german" english, I hope you got my point.

    Uwe

    • This is not the right place for regular XPages questions,but...

      By Philippe Riand 1 decade ago

      You should try to use a Java Vector instead of a JS array. I don't believe that JS array can be converted to Vector, only List