NOTES - Get general notes (Reports & Settings Report Generator function)

From Catalyst
Jump to: navigation, search

Syntax

$NOTES{reference, line, search, output-type}

Description

Returns a line of General Notes.

There are various General Notes variables throughout the Report Generator which return a General Notes reference number. This number relates to a block of General Notes that may have been entered for that item (e.g. an Account). $NOTES uses this number to return a line of notes.

For example: the variable A42 returns the number relating to any notes that may have been entered for the current Account. The following will return the first line of General Notes entered for the current account.
$NOTES{A42,1}

Another example: this gives the first line of General Notes that contains the text "Email:" (if any).

$NOTES{A42,1,"Email:"}

Another example: this gives the email address after the "Email:" prompt found in the previous example. It does this by first searching for the notes line that contains "Email:", it then finds the text after the "Email:" and then left justifies the text to remove any leading spaces.

$LJUSTIFY{$SUBSTR_AFT{$NOTES{A42,1,"Email:"}, "Email:"}, 50}


Parameters

reference
A text or numeric parameter that can not be omitted.
The General Notes reference number or Data ID.
line
A numeric parameter that can be omitted (it defaults to "1").
1-999
The line number of notes to return.
-1--999
Can be less than 0 only if search is being used.
search
A text parameter that can be omitted.
Optional text to search for.
Search for the line'th occurrence. If line is less than 0 then search for the line'th occurrence backwards from the end of the notes.
The case of letters does not matter, i.e. searching for "BOB" will find lines containing "BOB", "bob", or "Bob".
output-type
A text parameter that can be omitted (it defaults to "T").
Output option when search a text has been used.
T
Will output the text of the line where the search line was found.
L
Will output the line number where the search text was found.

Returns

A text or numeric (depending on the parameters) value. The line'th line of notes, or the line'th line of notes that contains search (if there is one), from the General Notes reference supplied. If the reference is zero (there are no General Notes for the current item) then nothing will be returned.