wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

View hidden fields while debugging.


A short one today. A typical pattern for Notes and Domino forms is to have hidden fields at the beginning and end of a form. These hidden fields store lookups, IDs, relations and all sorts of things. As a unwritten convention these fields are marked red and hidden from reading and editing (basically all hidewhen options are checked). While developing or troubleshooting applications it is important that you can see the values of these fields. So instead of checking all hide options I use the following approach:
I create a hidden Computed For Display field of type number named "IsNotDebug". I put this formula in:
@IsNotMember("[Debug]"; @UserRoles)
Then I use a formula in the hide when section: IsNotDebug. Is is kind of plain English: Hide when is not Debug.
By adding or removing the role [Debug] from your user-id you can switch on/off the display of the hidden fields. If you do a lot of local development, you might opt for a Environment variable instead of a role.
A final tip: To make things look better I often find hidden fields neatly put into tables with some explanations in the second column. This is not a good idea. Hide when formulas are executed separately for every paragraph in every cell. So you create a lot of extra computation. Best is to have the fields in a single paragraph (newlines with Shift-Control are ok). I use the pattern
Field : [the field] (Comment) | <-this could be just a bar or a new line.

Posted by on 14 June 2007 | Comments (5) | categories: Show-N-Tell Thursday

Comments

  1. posted by Stephan H. Wissel on Friday 15 June 2007 AD:
    @Michelle: I think changing the design is not really an option when troubleshooting a production system. For your situation you might opt for a Environment variable. So you would code @if(@Environment("IsDebugMode")="Debug";@false;@true). You can use an action bar button to set/reset your environment variables. Of course this would work for client apps only (unless the admin types SET config IsDebugMode=Debug for you at the console).
    Emoticon smile.gif stw

    @Slawek: haven't tried that
  2. posted by Slawek on Friday 15 June 2007 AD:
    What if you put the hidden fields layed out in a table into a section with a hide-when set to evaluate the IsnNtDebug?
  3. posted by Michelle on Friday 15 June 2007 AD:
    I use a section also, but set the section to always hide. If you put the hide-when on the section but not the section contents, you can show all your hidden fields by opening the section and hide them by collapsing the section on your form.

    This does involve editing the form each time you want to debug, but avoids switching roles, which I sometimes find doesn't work well, and of course can be a problem when working on local replicas. In addition, at some customer's I only have Designer access to applications, not Manager.
  4. posted by satish kumar on Sunday 17 June 2007 AD:
    Hi,iam satish from hyd,i am learning lotus since from last sept,am not good in webusing so please inform any good sites for lotuscoding and
    if i have any doubts in lotus through which site ihave to go .kindly inform me
  5. posted by Miroslav Navratil on Wednesday 20 June 2007 AD:
    I am using very similar approach with a minor difference. In some environments it might be difficult or time consuming to make changes in the ACL. Thus I am using a database profile to keep two fields. One is the list of roles that can see the hidden fields in debugging mode (to avoid hard codding) and the second one is there just to switch on/off the debugging mode.