A business partner approached me at Lotusphere with this problem, and after playing around with it a little, it seemed to me the workaround might be useful to others with similar requirements, so here it is.
Requirement: set up the Memo form so that if it contained collapsed sections (e.g. a reply thread), all the sections would be automatically expanded on open.
Problem: the function NotesUIDocument.ExpandAllSections doesn't work when used on a form that has a non-scrolling header, like the Memo form in the Notes mail file. You get the error message "Document command is not available." This was reported as SPR BHUY82WLWZ.
The corresponding @Command ([SectionExpandAll]) does work in this situation, but there was existing LotusScript code in the Postopen event that couldn't be rewritten in formula language.
You can't call a formula that uses the UI from LotusScript (well you can, but it doesn't do anything). So Evaluate and NotesAgent.Run were out. How do we combine the LotusScript event code with the formula command?
Answer: Fortunately, there are duplicate form opening events -- Postopen and onLoad -- so you can put your script in one and the formula in the other. They both execute, though I'm not sure offhand in what order.
Failing that (if it's for a different event), add a subform to the form and write formula for the subform event, and LotusScript for the form event (or vice versa).
Beware <script> in XPages
Delete empty folders, take 2
Wed, Apr 10th 2013 9:50a Andre Guirard I while back I wrote a post containing code to clean up empty folders from user mail files. Yesterday, someone pointed out to me that it doesn't take into account the fact that folders that contain subfolders can be technically empty, in the sense of containing no documents, but we don't want to delete them if they have subfolders which are non-empty -- or if they have subfolders we don't also want to delete. So I came up with a new version of the code that deals with those situations. As bac [read] Keywords: ldd
Wed, Mar 20th 2013 7:40a Andre Guirard In case it makes a difference for your application, here's how to tell whether you're running in the Notes browser plugin. So far, the only difference that's mattered to me is that the [FileExit] command doesn't work in NBP, causing an error dialog if you try it. %REM Function IsNotesBrowserPlugin Description: Return TRUE if we're running in the Notes browser plugin. %END REM Function IsNotesBrowserPlugin As Boolean Dim session As New NotesSession [read] Keywords: ldd
Are Apple customers allowed to marry non-Apple users?
Mon, Jan 21st 2013 2:00p Andre Guirard It's been an ordeal. I have an Android smartphone and use Gmail's calendar. My wife has an iPhone. You'd think it would be simple to have a shared calendar -- this is, after all, the future. As it turns out, it is possible, but the arduous process has made me wonder whether Apple considers it a form of apostasy for their customers to associate with someone who doesn't use their products. We had two alternatives to start with: we could create our shared calendar in Gmail or iCloud. No prefere [read] Keywords: ibm