I've been attempting to store a JavaScript IBM Notes Database Object in a variable called onPageLoad so that I can access it later in my code. Despite trying to use viewScope and sessionScope variables, they consistently return null.
onPageLoad:
var db_rooms: NotesDatabase = session.getDatabase(session.createName(doc_ProfileConfig.getItemValueString("ServerNA")).getCommon(), doc_ProfileConfig.getItemValueString("FilePathTX"));
viewScope.put("ResroomDb", db_rooms);
I rely on db_rooms to retrieve data onPageLoad, confirming that it is indeed a valid database object.
However, when I attempt to retrieve my Database object later on:
var db:NotesDatabase = viewScope.get("ResroomDb");
This approach leads to an error message stating "Unable to load (status 500)."
I have experimented with both Session and ViewScope without success. Is it possible or advisable to store the Database Object in Application scope since it's a single-page application?