Friday, March 30, 2012

Create Lotus Notes views on fly

I'm wondering if somebody know how to use views that I created on fly, lets say we have document with embedded view which is not created yet. Before we open this document we create view (but simple triggering agent). However we can't use this view as embedded view on document till we reopen database. Anybody has any idea how we can avoid this problem?

3 comments :

Richard Schwartz said...

Is it possible for you to create a set of dummy views (SELECT @All, and just one column) ahead of time? Then you could use your code to modify them on the fly for your specific needs. I think it should be possible to embed them without closing the database if you do this.

TexasSwede said...

I often solve this by building a "view" in a rich text field on a form instead. I build each row as a separate document, the render it into the rich text item. That way I can create "views" that are multi-line and with very nice layout, pretty much the same as repeat controls in Xpages.
I blogged about this here: http://www.bleedyellow.com/blogs/texasswede/entry/dynamictables
(And yes, i will fix the download when I get home tonight!)

Anonymous said...

I know this is a very old post, but in case you still want to know if you can do this, the answer is yes. I, along with Bob Balaban, wrote a product that shipped with Notes 6.0.x as well as 7.0.3 (maybe 2, can't remember) and up in the v7 timeframe (i.e., not in v8 or later). The product is called Notes access for SAP Solutions (NaSS). Within it I did something that has never been done before - I built, and displayed, an entire form - including 1-n fields with default values - on the fly, without needed to restart the Notes client. The techniques I used there will allow you to really build any type of design element on the fly in the same way.

Of course the need for much of what I did there is negated with xpages and the ability to use stuff like repeats, dynamic views, etc. But, sometimes the old school stuff is still valid, and even occasionally useful... ;)

I had some other innovations in there of which I'm, quite frankly, pretty proud. One such thing is that I came up with a way to custom build/modify database templates on the fly. The process is fully self-documenting (IOW it logs all elements that were added, deleted, or modified), and it backs everything up so it can be reversed. The process also makes it easy to, say, upgrade your base template and then reapply the changes - which is exactly what it was built to do. There were seven different features that you could choose to use in NaSS, and these features were in the mail db and the personal nab db. My code walked the admin through a wizard to choose the desired functions to deploy - any combination of the seven available - and it would build custom, supported versions of the mail and personal nab templates for them. These templates could also be restored to the stock design with the tool as well.

If you happen to still have a copy of the db (NaSSinstall.nsf), I documented the code pretty well, so you should be able to follow what I did.

If you (or anyone else) is interested in exploring this further or have some questions, feel free to let me know at lotus DOT geek AT gmail DOT com, and I'll try to help when I have some free time.

NOTE: Do not write me and basically ask me to write your entire app. I'll give pointers, even send some example code to get you started, but I don't want to do it all - unless you pay me, of course ;)
(BTW, this is NOT directed at you, Dmytro - I know you would never do that, nor would you need to)

Cheers!

--Rock (aka LotusGeek)