The field merge code describes data to be obtained from the
eCandidus™ database. The easiest way to obtain a field merge code is to view
the field in an entry (Case, thing to do, etc) and , and then
pasting the field definition into the document or form.
Syntax: [\<field>@<option1>@<option2>...]
The portion before the @ symbol is the field definition, which is
the code for the field to be merged. Each field has a code, and
there are literally thousands of fields. Rather than having to
learn and remember these code, eCandidus™ Desktop provides an
easy way to get the code for each field. Simply view the entry
which contains the field, and click on the option icon, selecting the "Copy
Field Definition to Clipboard" entry. Now switch to the document
or form, and paste (Ctrl-V) the definition in the appropriate
place.
A sample field definition looks like:
[\Plaintiff#0\Name#1]
Lets break down the definition and explain its components:
| Field | Index | Meaning |
| Plaintiff |
0 |
Get the plaintiff record, if there are more than one plaintiffs ask which plaintiff to use. |
| Name |
1 |
Get the name. If there are more than name, use the first found. |
Index Variations
As you see in the example, the index tells the system which value
to use. You can also tell the system to use a range of values as
shown in this example:
[\Plaintiff#>\Name#1]
This tells the system to return a single column table of names
for plaintiffs, returning all plaintiff names from 1 to 10.
You can tell the system the limits to return:
[\Plaintiff#>2,5\Name#1]
This returns the names for plaintiffs 2 to 5. You can also
return the reverse list by:
[\Plaintiff#<1,8\Name#1]
Returns the plaintiffs 8 to 1 in that order.
Note that the options for table are available for this type of
indexing so:
[\Plaintiff#>\Name#1@A]
Returns the list of plaintiff names, separated by ", ", so it
would look like:
John Smith, Jane Doe, Mike Rooney
Options
Options are used to modify the value to be merge, providing for a
simple way to format the value.
How options are used
Let's say that we are working with field Amt:
[\Amt@fc] - Takes the value of the amount field and formats it like currency, so if
the original value was 5678.6, it will be transformed into $5,678.60
[\Amt@T] - Takes the amount field and translates into text, so in the example of
5678, it will return
five thousand six hundred and seventy eight.
[\Amt@T@SU] - You can stack options to combine their effect, here we tak the same
as the example above and convert the result to uppercase, so the
resulting text will be
FIVE THOUSAND SIX HUNDRED AND SEVENTY EIGHT
Options available for all fields:
- J<type><Size> - Justifies the text of the field
according to the type:
R - Right
L - Left
C - Center
and the size is the number of characters in the field.
- S<type> - Changes the casing of the string according
to the type:
U - Upper case
L - Lower case
C - Capitalize each word
- F<format> - Formats the numeric value of the field
according to the format:
C - Currency
D - Decimal
E - Scientific
F - Fixed point
P - Percent
X - Hexadecimal
Also a picture format:
# - Digit placeholder
0 - Zero placeholder
. - Decimal point
, - Thousands separator
- T - Converts the numeric value of the field into text: 523
<-> Five Hundred and Twenty Three.
- SUBSTR:<start>:<end> - Returns the string from the starting
position to the end. If the starting position is not given, the start of the
string is assumed. If the end position is not given, the end of the sting is assumed.
- X<chars> - Remove given characters from string. If no
characters are given, the system will remove all non alphanumeric
characters.
- <<text> - If the text value of the field is not
empty, the text given will be used as a prefix to the
value.
- ><text> - If the text value of the field is not
empty, the text given will be used as a suffix to the
value.
- $<match1>$<rep1>$<match2>$<rep2>...
$<def rep> - The text value of the field will be compared
to each match value, and the replacement will be used if the
match is found. Otherwise the default replacement is used (if
any). Note that if <rep> starts with \, the field is
evaluated.
- \<field> - If the previous field definition returns empty, use this definition instead.
- =<extensionname> - Sets the extension field to the current value.
- #<index><del> - Picks the Nth item from the list delimited by del.
- # - Sets the current value to empty string.
- ##<value> - If the string is empty, return the value.
- CB - Returns X if the string is the same as Y.
- NCB - Returns X if the string is not the same as Y.
- SCB - Returns X if the string has a value (is not empty).
- NSCB - Returns X if the string has no value (is empty).
Conversion Options:
- AsName - Capitalizes the value as a proper name
- AsDate - Formstas the value as a date
- AsTime - Formats the value as time
- AsDateTime - Formats the value as a date and time
- AsPhone - Formats the value as a phone number
- AsZIP - Formats the value as a ZIPCode
- AsSS - Formats the value as a Social Security
Options available for name fields:
- FirstName - Extracts the first name portion of the value
- LastName - Extracts the last name portion of the value
- MiddleName - Extracts the middle name portion of the value
- MiddleInitial - Extracts the middle initial portion of the value
- Suffix - Extracts the suffix (jr, sr, etc.) portion of the value
- Sort - Returns a sortable representation of the value
Options available for date and time fields:
- Month - Returns the month portion of the date
- Day - Returns the day portion of the date
- Year - Returns the year portion of the date
- Minute - Returns the minute portion of the date
- Sortable - Returns a sortable representation of the
date
- DayOrdinal - Returns the ordinal value of the day portion of
the date
- MonthName - Returns the month portion of the date as a month
name
- DayOfWeek - Returns the days of the week name of the pay
portion of the date
- MonthAbbrev - Returns the month portion of the date as a
three character month name
- FormalDate - Returns the date in a month, ordinal day and
year format
- FullDate - Returns the date preceded by the date of the
week
- LegalDate - Returns the date as "DateOrdinal day of
MonthName, Year" eg: 2nd day Of October, 2008
- BusinessDay - Adjusts the date to be the closest business
day
- PreviousBusinessDay - Adjusts the date to be the previous
business day if not so already
- +/-<number>d/w/m/y - Adds/Subtracts the number of
periods (days, weeks, months or years)
Options available for table fields:
- B<onoff> - Displays the grid lines if onoff is set to
1.
- C<colname1>:<colname2>:...:<colnamen> -
Selects which columns to display.
- J<just1>:<just2>: ... :<justn> - Sets the
justification for each column. Each justification definitions is
defined as <Type><Size>, where the type is one of the
following:
R - Right
L - Left
C - Center
Note that the width is given as inches and zero width leaves
column unchanged.
- W<width1>:<width2>: ... :<widthn> - Sets
the width of each column. Note that the width is given as inches
and zero width leaves column unchanged.
- A<delimiter>:<colname>:<row1>: ..
:<rown> - Returns the column as a delimited list. If the
delimiter is omitted, a comma and space will be used. If no rows
are defined, all the rows will be used. Options will be applied
to each row in the array before they are concatenated.
- L<delimiter>:<row>:<colname1>: .. :
<colnamen> - Returns the row as a delimited list. If the
delimiter is omitted, a comma and space will be used. If no
columns are defined, all the columns will be used. Options will
be applied to each column in the array before they are
concatenated.
- sort:<col # or name><a or d>:... : Sorts the table on the
given column or columns. You can specify either a column name or number,
followed by a for ascending or d for descending. If no
direction is given, ascending is assumed.
Options available for image fields:
- W<size> - Width of image.
- H<size> - Height of image.
Special options:
- lawcode - Returns the text associated with the law code.
Work Product Fields
There are a set of fields that are available when merging from a work product (case, property, etc.).
Syntax: [\WP\<Code>]
| Code | Meaning |
| ActivityCodes | Returns an array of work product codes and units. This comes from the History |
| ActivityCodesTotal | Retuns the total of units. This comes from the History |
Global Fields
There are a set of fields that are available at all times:
| Group |
Code |
Sub |
Meaning |
| System |
Today |
|
Today's date |
| |
CurrentAddressBlock |
|
The last address block displayed. |
| |
CurrentDocumentName |
|
The document name being used. |
| |
Clipboard |
|
The contents of the clipboard. |
| |
Organization |
Name |
Your organization's name |
| |
|
Address |
... address. |
| |
|
Suite |
... suite. |
| |
|
City |
... city. |
| |
|
County |
... county. |
| |
|
State |
... state. |
| |
|
ZIP |
... zip. |
| |
|
Phone |
... phone. |
| |
|
Fax |
... fax. |
| |
UserDefined1 |
|
User defined field #1. |
| |
UserDefined2 |
|
User defined field #2. |
| |
UserDefined3 |
|
User defined field #3. |
| |
Associate |
Signature |
Your signature. |
| |
|
Nickname |
Your nickname. |
| |
|
ContactInfo |
Your contact info. |
| |
|
SigningFor |
The associate that you sign for.
|
| |
|
SigningForTitle |
The title of the associate that you sign for. |
| |
|
SignatureBlock |
A text represenrtation of your signature. This field cannot be used in forms. |
| |
|
SignatureImage |
A graphic represenrtation of your signature. This field cannot be used in forms. |
An example is [\System\Today@FormalDate] which will return the
current date in a format similar to Jan 12, 2008.