XPages Javascript - Getting the current database

Hi,

This may be a strange/simple/silly question, but how do you get the current database when working with Server Side Javascript?

I am currently getting the database using :

//var database = session.getDatabase(session.getServerName(), “glaapp\TLRS.nsf”)

var database = session.getDatabase(session.getServerName(), “Dev\TLRS.nsf”)

As you can see, I have had to comment out the live database when working in dev and when i make the db live, i need to remember to change this back or distaster strikes!

Really appreciate some guidance. I have tried the 8.5.1 help, but i find it quite poor compared to 6.5 etc (not as many examples etc)

Thanks

Jamie

Subject: I believe “database” is a global SSJS object…

  • Like context and a bunch of others, so the current database should be immediately accessible.

  • The “script editor” has a panel on the left that lists these globally predefined objects.

Hope this helps…

Subject: Great!

Apologies for the late reply…

That worked a treat - thanks very much.

New to the whole SSJS and such like, so this really helps.

Thanks again

Subject: Glad I can also be a positive influence here!