This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 12, 2012, 6:04 AM
22 Posts
topic has been resolvedResolved

Strange issue with getDatabase

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: getDatabase,ACL
  • Replies: 0
I have a strange issue with a piece of code.
I use
 
        // GET MAILFILE FOR USER
        this.getMailFile = function() {
        try {
                        var notesdir:NotesDirectory;
                        notesdir = session.getDirectory();
                        return notesdir.getMailInfo(this.strUser, false, false).get(3);
        } catch (e) {
                        return '';
                        }
        }
 
to get the mailfile for a user.  Further on, I try to open the file with the followong line of code:
 
        this.createEntry = function() {
                if (this.strSubject == "") return '3';
                if (this.strUser == "") return '5';
                if (this.getMailFile() == '') return '1';
                try {
                         var db:NotesDatabase = session.getDatabase(this.getMailFileServer(), this.getMailFile(), false);
                        //var db:NotesDatabase = session.getDatabase('', 'mail\\ukrause.nsf', false);
                        if (db == null) {
                                return '2';
                        } else {  
 
The code throws an exception 

Exception

Error while executing JavaScript computed expression
Script interpreter error, line=1, col=32: [TypeError] Exception occurred calling method NotesSession.getDatabase(string, string, boolean) null
 
First thougt was that it has to do with the backslash and so I used static values for server and file, but same error.
 
The code successfully  runs on another server ( same version ) 
 
My maildb has standard ACL settings with default and anonymous set to NoAccess. Server an I are Manager.
What I found so far is that on THIS server  getDatabase() only seems to work, when Anonymous has at least reader Access.
 
So, when I set Anonymous to Reader, getDatabase works. 
 
Anyone to open my eyes? There must be something obvious that I'm missing, but I'm too blind to see. 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal