parasol consultancy limited
0800 083 7663
parasol logo
 

SOLCASE TIPS - JANUARY 2007

PASSING VALUES BETWEEN SCRIPTS USING TEMPORARY FIELDS

We suggest that you might also want to read Understanding and coping with Null values

Temporary fields in Solcase can be a little troublesome if you don't understand the pitfalls. (N.B. Visualfiles users are generally better advised to resist using TF fields and use instead LF or GF fields or the PI/PO parameters although the Solcase code will still work for them).

TF values can persist between scripts and sometimes linger around in the background afterwards as well. It is therefore generally good practice to "declare" your temporary fields at the beginning of the script so that you know (a) you are not picking up a rogue value from somewhere else and (b) Solcase knows what data type you intend for the field e.g.

[&Assign TF01=""]
[&Assign TF02=""]
[&Assign TF03=0]
[&Assign TF04=0]
[&Assign TF05="31/12/1979"]

Although some regard this as unnecssary, I also suggest that, unless you are not passing the value somewhere else, you clear them out at the end of the script too. The difference being that you always assign them to blank regardless of the data type.

[&Assign TF01=""]
[&Assign TF02=""]
[&Assign TF03=""]
[&Assign TF04=""]
[&Assign TF05=""]

You can however also use the fact that TF files persist to pass values from one script to another. N.B. my own preference is usually to have a User-Defined screen called HID with a series of blank text, number and date fields in which I use to hold the values (the comments above about clearing the fields out when you start and finish applies even more so to these) .

Have you ever wanted to use a script both by prompting the user for a value or by passing the the value from another script? Easy you might think, just use a TF temporary field. However the problem is trying to test whether the field is blank or null. If there is nothing in the TF field then its Progress value is actually something like "[Error: Temporary field 101 not assigned]" so neither of the following work reliably:

[&If TF101=""] or [&If TF101<>""][&Else]

see Understanding and coping with Null values for a fuller explanation. However the proval modifier comes to our rescue again. The code below will test if a value has been passed and prompt only if no value has been received.

  article by Richard Arney


SEG USER FORUM

Unfortunately we have had to suspend this useful service as some users objected to publication

ABOUT PARASOL

Parasol was originally conceived in 2005 to provide expert help for solicitors struggling to get a return on their investment and make the best of their Solcase or Visualfiles installation.

The Parasol Consultancy Group was initially set up by:-

Richard Arney
Affik Choudhury
Andrew Hall
Tim Long
Bryan Tulloch

SAMPLE CODE

To test whether TF01 has a value use the following:

[&Assign TF901="("+quote+TF01+quote+")":proval:text]
[&Assign TF902 = "length("+quote+TF901+quote+")":proval:number:whole]
[&If TF902=0]
   [&Assign TF01='Enter value as none received']
[&EndIf]

[&Assign TF901=""]
[&Assign TF902=""]

 

You could also use the following to check for errors:

[&Assign TF901="("+quote+TF01+quote+")":proval:text]
[&If TF901 &Begins "[Error"]
   [&Assign TF01='Enter value as none received']
[&EndIf]

[&Assign TF901=""]
[&Assign TF902=""]

If you just want to test for an error OR a blank then replace [&If TF901 &Begins "[Error"] with [&If TF901 &Begins "[Error" &Or TF901=""]

WARNING: If you have just run a script like this on a matter then TF901 now has a value of blank which will stick around usually until you exit that matter or reassign it. Therefore there is an argument here for NOT clearing that particular TF field at the end of the loop depending on what you are trying to achieve.