HotDocs Tips & Tricks

Tips, tricks and solutions with the HotDocs document assembly platform
Wednesday, July 15, 2009

GRAY, UNGRAY, SHOW and HIDE


These four commands are essential in presenting user friendly and user-proof dialogs in HotDocs.  When designing systems, it is generally best practice to show only those variables that require (or may require) an answer and HIDE or GRAY those that are irrelevant.  HotDocs provides a rudimentary manner to handle this automatically, but if you are designing complex systems, you may need to use these four commands.

All of these instructions are used in dialog scripts only.

GRAY Var          //grays Var, prohibiting data entry, but displaying the value (if any)
UNGRAY Var     //UNgrays it, allowing data entry
HIDE Var           //completely hide the variable
SHOW Var        //opposite of HIDE

Here are some examples that should be fairly self explanatory…

//hide the company type, only showing it if relevant.
HIDE PARTY Entity Company Type MC
IF PARTY Entity Type MC "Company"
 
SHOW PARTY Entity Company Type MC
 
REQUIRE PARTY Entity Company Type MC
END 
IF

//calculate a total amount, but gray it so it isn't editable
GRAY SALES Grand Total NU
SET SALES Grand Total NU TO ZERO 
SALES Amount NU ) + ZERO SALES Tax NU ) - ZERO SALES Discount NU )
//allow them to manually change it if they REALLY want to
IF SALES Grand Total Change TF TRUE
  UNGRAY SALES Grand Total NU
END 
IF

Instead of using a variable name, you can also substitute the “ALL” parameter....

GRAY ALL //grays everything on the dialog
UNGRAY ALL //ungrays everything

When building a system to really lockdown data entry, you may wish to write a dialog script something like this to force entry of everything in the correct order…

HIDE ALL
SHOW PARTY Entity Type MC
IF ANSWERED PARTY Entity Type MC //must have a type before we allow name entry
 
SHOW PARTY Name TE 
 
IF PARTY Entity Type MC "Company"
  
SHOW PARTY Entity Company Type MC
  
REQUIRE PARTY Entity Company Type MC
  SHOW PARTY Entity Company Number TE
 END 
IF
IF 
ANSWERED PARTY Name TE //must have a name before they can proceed further
 //more SHOW/REQUIRE pairs here
END IF
END IF

All of these commands are dynamic as of HotDocs 6, which is a major step forward.  Whilst they may look like eye candy, these instructions serve to produce better and more accurate documents every time, simply by forcing/prohibiting better data entry.  When combined with REQUIRE, you really can obey the rule that “if a variable is visible, it must be answered and if it is invisible, it is irrelevant”.  When your systems can follow this rule, your users do not have to have any knowledge of what they are working with or understand the sometimes complex concepts behind the scenes - all they need to know is that if it CAN be answered, it SHOULD be answered and if it cannot be seen, don’t worry about it.

Posted by Ian Burrows
Page 1 of 1 pages

Statistics

Page Views: 18168
Page rendered in 0.8946 seconds
34 queries executed
Total Entries: 155
Most Recent Entry: 03/12/2010 07:18 pm
Total Members: 5
Total Logged in members: 1
Total guests: 18
Most Recent Visitor on: 03/15/2010 07:59 am
Most visitors ever: 66 on 03/13/2010 09:21 pm