Insert numerical fields into a transaction description
You can insert your own fields into transaction descriptions, assigning them either constant values or values calculated by expressions.
Use this procedure:
- Put your cursor in the transaction field just below where you want the numerical field to be inserted.
- Click the New field button (the top one). The Properties dialog is displayed.
- Type a Field name you can recognize (but not the name of an existing field on the invoice profile, even if that field is not included in the transaction description) that does not start with special characters such as "#" or "¤".
- For Format, type N(i) where "i" is the maximum possible length of the value you want to insert.
- In Pad character, type any character (such as asterisk) to use as filler in case the actual value is shorter than the specified length. You can also type an ASCII value for a character (1 <= value <= 255).
- In the Length box, type the number of characters again.
- In the Expression edit box, type the specific number you want to appear in the transfer file, or an expression that calculates the value you want to appear. See below for more information about expressions.
- Click OK.
The table below lists the characters that are valid in expressions used to define your own numerical fields.
|+||Plus||FieldA + FieldB|
|-||Minus||FieldA - FieldB|
|:||Sum of fields from/to||FieldA : FieldB|
|*||Multiply||FieldA * 10|
|/||Divide||FieldA / 2 (If both operands are integers, the result is an integer.)|
|%||Remainder||FieldA % 100 (returns the remainder of FieldA / 100)|
|?||Does the field exist?||?FieldB (returns 1 if the field exists, otherwise 0)|
|( )||Parentheses||(FieldA+FieldB) * FieldC|
Decimals are allowed in all expressions. However, make sure that the format of the transaction field allows for the maximum number of decimals that can result from the expression.
Rules for expressions
- The maximum number of characters in an expression is 255.
- Though in the expression you can refer to fields containing or receiving numerical values, you cannot refer to fields containing text.
- Do not use the equal sign (=) to assign a value to your own numerical fields. An equal sign assigns a default value to a transaction field.
- The value assigned to this type of field, whether it is a constant or derived from an expression, must not have more than 15 significant digits or contain a decimal. Numbers with more than 15 digits are truncated.