Best practice of how to store custom session variables in iNotes 8.5.1

I have several custom iNotes session variables (example: calculation of DB size minus whitespace) that I use in a custom quota function to disable mailsend capabilities in the iNotes interface. I want to know the current “best-practice” way to make these variables available throughout the entire iNotes interface. The variable is calculated once per session (or by manual button-click) and does not live longer than the session.

Since R5, I have been using an XmlHttpRequest to get the DB size data from an agent in the mailfile and store it in a session cookie, since I didn’t know any better way to make it available throughout all iNotes scenes.

However, I am assuming that there is a better and more efficient way to store such a variable. I would have liked to store it in the DOM or a javascript object, but I was not knowledgeable enough about the haiku object to copy its methodology.

In the iNotes Lite articles on the Wiki, have read about Common Properties and this seems promising.

Could someone please tell me what is the preferred way to store custom session variables in the iNotes Lite architecture?

Subject: com_ibm_dwa_globals

First, I want to clarify about the code architecture. Starting in 8.5, iNotes is using the new tabbed UI and code architecture that was introduced with Lite mode. However, not all of the forms have been migrated to the new architecture, yet. The following forms still use the old (“classic”) architecture:

Full mode Mail, Calendar, Contact, To Do, Notebook entry forms

Lite mode Calendar and Contact entry forms

Home page

Preferences

Although it looks like both new and “classic” architecture forms are opened in a new tab the same way, that’s not really the case. A new form is opened in a DIV element, which means it shares the DOM of the main window. But the “classic” forms are opened in an IFRAME.

If you want to store a JavaScript variable in a place that will be accessible everywhere, you could store it in the com_ibm_dwa_globals.oSettings [AAA.FWz] object. That will be directly accessible in all views and new forms. And you can access it via window.parent.AAA.FWz from a “classic” form.