The HotDocs Computation Archive
Get Extra Help

0131 - Fast-tracking Repeated Dialogs

Description:

How to have a repeated dialog jump directly to the end. In other words, how to skip all answered levels of the dialog and go directly to the "add a record" screen.


• Explanation •

At times it is nice to skip over the ANSWERED levels of a repeated dialog so that you can immediately begin entering new data. Think of this as a "data entry only" version of the repeated dialog. There are a couple of techniques for doing this. The preferred method requires HotDocs 5.2 or better. For older versions of HotDocs, a more cumbersome but equally effective method is also provided.


•  •  •  •  •  •  •


• Code •

(Computation to ASK the Dialog)

ASK NONE
SET DialogCount-n TO COUNT( Dialog )
ASK DEFAULT
ASK Dialog
 
 
(Dialog Script)

IF COUNTER < ( DialogCount-n + 1 )
   HIDE ALL
ELSE
   SET DialogCount-n TO 0
END IF

• Explanation •

For HotDocs 5.2 or higher, hiding all of the variables in a repeated dialog prevents that level of the dialog from being asked. We can use this technique to hide all answered levels of the dialog.

First we need a computation which checks how many answered levels the dialog contains. We set this COUNT to a temporary number variable called DialogCount-n (set its Advanced options to "Ask only in dialog," "Don't warn if unanswered," and "Don't save in answer file").

Next we need a dialog script to test whether each level of the dialog should be shown or hidden. Every level less than the dialog's COUNT will be hidden. Once the dialog's COUNT has been passed, all fields will be made visible. This effectively takes the user directly to a blank screen.

When the blank screen is displayed, we also SET DialogCount-n TO 0. This will allow the user to then use the "Previous" button to move backward through all previous levels of the dialog.

Contributor: Bart Earle


•  •  •  •  •  •  •


• Code •

ASK NONE
SET Counter-n TO COUNT( Dialog )

ASK DEFAULT
REPEAT AddDialog
   SET Counter-n TO Counter-n + 1
   SET FieldOne[ Counter-n ] TO addFieldOne
   SET FieldTwo[ Counter-n ] TO addFieldTwo
   etc.
END REPEAT

ASK NONE
REPEAT AddDialog
   SET addFieldOne TO UNANSWERED
   SET addFieldTwo TO UNANSWERED
   etc.
END REPEAT
ASK DEFAULT

• Explanation •

Create a copy of the repeated dialog which has analogous fields and scripts. This dialog will collect the information to be added, and will always start with a blank screen because you will clear it at the beginning of the assembly.

Once you have gathered the new information, you copy this onto the end of your original repeated dialog. The computation above will gather the new information with the "add" dialog, copy the information onto the end of the original dialog, and then clear the "add" dialog so that it is blank and ready for the next use. It requires one temporary number variable called Counter-n (set its Advanced options to "Ask only in dialog," "Don't warn if unanswered," and "Don't save in answer file"). The original dialog is called Dialog and the copy is called AddDialog. The fields on AddDialog are analygous to the fields on Dialog but begin with the prefix add.

Hint: An easy way to create the second dialog is to copy the first dialog to another template through Component Manager, then open the second template and rename the variables and the dialog, then copy it back to the original template.

Contributors: Pete Hoffman; LegalCS

 

• Contributors •

  Bart Earle
Senior Consultant
Capstone Practice Systems, Inc.
231 Woburn St.
Lexington, MA 02420
781.652.8419
  Pete Hoffman
Creative Process, Inc.
www.prudentjurist.com
(704) 433-6368
  LegalCS