I have this form, and on the form is a field. The field is populated by doing an @DbColumn() call to a view in another database. The documents in that view are protected with reader-names fields, which are themselves group names. By adding a user to one of the groups, they see more documents. Makes sense, yes?
Now, suppose a user is on page with this kind of field on it, and does a submit or something which cases his name to be added to a group that should let him see more documents from that view. How long do you suppose it should take for him to see additional documents?
Wrong.
If I just continue to do it the way I have been, with a dbColumn() call in the field on the form -- it can be a really long time. In fact, it can be measured in minutes from the last refresh. That seems to mean if you keep looking for the change you keep delaying it.
In debugging this, I tried everything -- including "noCache" on the lookup and even named caches (which I don't even know are still valid) and server side settings for user cache duration and such. Nothing.
Finally, I created a WQO (Web Query Open) agent and had it set to run as the web user (his credentials), open the same view, and just output to the Domino console which documents it could see. Guess what...In the LotusScript WQO the update was nearly instant. Nonetheless, even then the lookup only returned the original documents.
I had the WQO write the values to the field instead -- and that worked a little. Of course, due to the nature of a WQO agent, no other fields on the form could use the value for calculation. In the end, what I did was create a text field set to computed for display called "[dscript]". I set the formula to simply the field name, so it always set itself to its own value. I also put the field in a text area that was set as style "HTML Passthrough". Finally, I had the WQO agent write javascript as text to the field like so: "<script> var lookupArray = new Array('val1', 'val2', 'val3', 'val4' .....); </script>"
Now, the rest of the javascript on the form has access to that array of values I wanted -- updated almost as soon as you add the person's name to the group. Oh, and STILL the @DbLookup does not update.
Comment Entry |
Please wait while your document is saved.
The HTTP task looks up the users credentials like the groups he belongs to. For
the next request, it uses the cached value. Every request seems to restart a
kind of timer. Thus if you do not do requests, the timer will timeout after x
minutes, if you do request in the meantime, the timer is restarted.
The WQS agent on the other side seems not to use the same name lookup context
and gets the credentials directly from the server.
Just my 2 cents
Thomas
http://www.asssono.de/blog.nsf/