Posts Tagged ‘dialog’

ASK DIALOG and ASK VAR

The ASK instruction does exactly what it appears it will do – forces HotDocs to ASK (present to user) a specific variable or dialog. ASK is quite often under utilized, as many developers permit HotDocs to generate a template interview. For those developers in the know, there is a lot more functionality, flexibility and control possible when you write your own interview. For those developers who design their own interviews, use of the ASK statement is absolutely critical.

In its simplest form, you simply ASK a variable or dialog. Lets say we are designing a conveyancing/real estate master interview. We have borrowers, lenders, their counsel and perhaps a guarantor or two. The borrowers may not necessarily always have representation, nor will the borrowers always have a guarantor. So here’s how our interview might look:
In its simplest form, you simply ASK a variable or dialog. Lets say we are designing a conveyancing/real estate master interview. We have borrowers, lenders, their counsel and perhaps a guarantor or two. The borrowers may not necessarily always have representation, nor will the borrowers always have a guarantor. So here’s how our interview might look:

ASK BORROWER DLG//basic information - how many borrowers, any shared address for service - details common to all borrowers

IF ANSWERED ( BORR Num LMT ) //force user to specify how many borrowers there are going to be
ASK BORROWERS RPT//info for each borrower
END IF
IF BORR Counsel TF//did the user specify that the borrowers had counsel?
ASK BORROWER COUNSEL DLG
END IF
IF LOAN Guaranteed TF//did the user specify that the loan was guaranteed?
ASK GUARANTOR DLG//if so, grab guarantor details as well
END IF

With developer designed interviews and the ASK instruction used in conjunction with IF statements, we can minutely control the interview and user experience. ONLY those dialogs necessary are presented to the user, which reduces the chance of erroneous data entry, while forcing the user to be presented with the dialogs and questions that are necessary to complete the specifics of each transaction. Dynamically. Efficiently. Correctly.

Expression Model: ANSWERED(VAR) and ANSWERED(DIALOG)

This tip covered the expression models: ANSWERED(VAR) and ANSWERED(DIALOG). Most often these are used in templates, but they are also used in computations to test whether a variable or a dialog has been answered. Hotdocs scripts will be interrupted if the value of any required variable is not known. For this reason, the use of the”answered” function gives a value where no value is known.

What are the elements?

ANSWERED: The function

VAR: Any variable. All variables will have an “answered” or “unanswered” status. Note, that you can force an answered status on a variable under two conditions: (1) if the variable has a “default” and the dialog on which the variable appears has been asked, or (2) the variable is a True/False variable on a dialog with an Ask All setting and that dialog has been asked.

DIALOG: Any dialog. This tests whether the dialog has been “asked” in an interview.

Usage of ANSWERED expression:

Usage is disparaged by the software developers as “unnecessary”. A properly designed template should have sufficient nesting of logic such that you need not test whether a particular variable has been answered. This is particularly true when you use variable in IF EXPRESSIONS.

It is also disparaged because the way HotDocs does (or rather does NOT) clear data. If a variable is “hidden” based on a dialog scripting rule, the hidden variable still retains its value. For this reason, you should not depend on the answered status of a variable to determine whether a phrase should be included if there are parent conditions not expressed in the template.

Usage is recommended if you want something special to happen, other than the ordinary, if a variable has not been answered. While you can use “tokens” in the advanced properties of a variable, you may want to put the rules into a computation.

Limit Spreadsheet Lines Appearing

You want to control the number of lines that appear on a dialog that displays in “Spreadsheet” style. Quite often, the default number of lines visible on a spreadsheet style dialog are aesthetically offensive. We need to control this for two reasons: 1) its ugly; and 2) screen real estate is quite often at a premium.

Basha Systems use a CNT prefix for specific purpose number variables, to differentiate between a “true” number variable used in document assembly templates, and those number variables used for tracking, counting & limiting. Lets presume we are dealing with a spreadsheet to enter in children’s names and DOB’s. In the dialog PRIOR to the spreadsheet dialog relating to children, create a variable something similar to Var_CNT. The prompt should be something like “How many children do you wish to enter?” In the script of the spreadsheet dialog, place the following:

LIMITVar_CNT

This will ensure that the spreadsheet is LIMITed to the number of lines that the user has indicated are required. You may wish to REQUIRE the Var_CNT variable, so the user must enter a number to gain access.

If the spreadsheet dialog is actually “Spreadsheet on Parent”, you should script the dialog so that it doesn’t even appear until such time as the Var_CNT variable has been answered. Using this approach, the REQUIRE option is redundant.

SET Command and GRAYed Variables

You need to SET the value of a variable, but want users to be able to edit the value even after it is SET. HotDocs will GRAY a variable (prohibiting editing) if the SET command is processed on the dialog, and DEFAULT will not overwrite a variable’s value.

A “regular” script to SET a variable to a value (based upon a Multiple Choice variable) probably looks something like this:

IF ANSWERED ( Var_MC )
IF Var_MC = “1”
SET Var1_TE TO “red”
ELSE
SET Var1_TE TO “blue”
END IF
END IF

As soon as Var_MC is answered, Var_TE will acquire an appropriate value, and subsequently GRAYed out – because it is processed dynamically by the dialog script, and whilever those conditions are met, the variable will not be editable.

We need to avoid HotDocs GRAYIng the variable. The solution? A button that calls a computation.

Lets say we create a variable called Var1_CO – this is the variable that will be called by the button on our dialog. The content of this computation will be exactly the same as the script above. We don’t wish to do anything different, we just wish to shift the source of the SET command.

In our dialog additional text section, we type

@COMPUTE:Var1_CO: Populate

@COMPUTE is the command to tell HotDocs we want a button to call a computation. Var1_CO is the name of the computation variable we are calling. Populate is the button text which will be displayed. When we click this button, the value is SET (provided all conditions have been made), and the variable is editable.

Adding Spacing to Dialog Elements

When working with Dialog Elements, particularly Horizontal Lines, you may wish to add a line (or vertical space) before the dialog element. You COULD add a separate dialog element for the spacing. But that adds to your scripting and dialog management. Instead, you should add a <.pm> Code before and after the Prompt for the Dialog Element.

Create the Dialog Element

Set to Horizontal Line

Choose Alignment: Left/Center/Right

In the Prompt, Right-click and add a Paragraph Marker

Type your prompt

At the end, Right-click and add another Paragraph Marker

Optional, you can add formatting around the prompt to control things like Bold and Italics.