• Two runtime errors when opening database with Lotus Notes client

    By Terry Boyd 1 decade ago

    There are two spots in the "global" SSJS library where unexpected runtime errors will be thrown if you open the application with a Lotus Notes client, and that application resides on a Domino server.

     

    The errors will appear similar to the following:

     

    Error while executing JavaScript action expression
    Script interpreter error, line=77, col=37: [TypeError] Exception occurred calling method NotesDatabase.getView(string) null
       at [/global.jss].initApplication()

     

    I believe the issue is that the logic is instantiating the database object based on the current session server, NOT the serve ron which the database resides. Therefore, you can resolve the issue by changing the following two lines of code (original code in red, modified code in green:

    In the "initSession" function:

    var thisDB:NotesDatabase = sessionAsSigner.getDatabase(session.getServerName(),session.getCurrentDatabase().getFilePath());

    var thisDB:NotesDatabase = sessionAsSigner.getDatabase(session.getCurrentDatabase().getServer(),session.getCurrentDatabase().getFilePath());

     

    In the "initApplication" function:

    var exDB:NotesDatabase = sessionAsSigner.getDatabase(session.getServerName(),session.getCurrentDatabase().getFilePath());

    var exDB:NotesDatabase = sessionAsSigner.getDatabase(session.getCurrentDatabase().getServer(),session.getCurrentDatabase().getFilePath());

     

    I hope this helps!

     

    T.