Miscellaneous Functions

UDP ›› Functions ››
Parent Previous

Function:  

OLD_VALUE  

Description:  

Returns the old value of the attribute before it was changed  

Parameters:  

An attribute of a business object or group  

Example:  

If  OLD_VALUE(Account.Balance) = 100 Then …

   

Function:  

TYPE  

Description:  

Returns the specific type of the member of the business object group as a string constant  

Parameters:  

The name of the business object group  

Example:  

If  TYPE (Account) = ‘PersonalSavingAccount’ Then … (this assumes that the Account is a business object group having PersonalSavingAccount as its member)

   

Function:  

SEARCH_COUNT  

Description:  

Returns the number of object instances found by the last query  

Parameters:  

None  

Example:  

FIND ALL Account

If  SEARCH_COUNT = 1 Then

   DISPLAY MESSAGE (‘One account was found’)

   

Function:  

FILE_EXISTS  

Description:  

Checks if the specified file or directory exists  

Parameters:  

An expression returning a string identifying a file or directory name  

Example:  

If  FILE_EXISTS(‘c:/myfile.txt’) = ‘Yes’ Then

   DISPLAY MESSAGE (‘File exists’)

   

Function:  

FILE_NAME  

Description:  

Returns the name of the specified file or document without the extension  

Parameters:  

An expression returning a string identifying a file or directory name or an attribute of the Document type  

Example:  

DISPLAY MESSAGE (‘File name is ‘ + FILE_NAME(‘c:/myfile.txt’))

   

Function:  

FILE_EXTENSION  

Description:  

Returns the extension of the specified file or document  

Parameters:  

An expression returning a string identifying a file or directory name or an attribute of the Document type  

Example:  

DISPLAY MESSAGE (‘File extension is ‘ + FILE_EXTENSION(‘c:/myfile.txt’))

   

Function:  

FILE_SIZE  

Description:  

Returns the size of the specified file or document in bytes  

Parameters:  

An expression returning a string identifying a file or directory name or an attribute of the Document type  

Example:  

DISPLAY MESSAGE (‘File size is ‘ + FILE_SIZE(‘c:/myfile.txt’))

   

Function:  

FILE_LAST_MODIFIED  

Description:  

Returns the date when the specified file was last modified  

Parameters:  

An expression returning a string identifying a file or directory name  

Example:  

DISPLAY MESSAGE (‘File modified  ‘ + AS_STRING(FILE_LAST_MODIFIED(‘c:/myfile.txt’)))

   

Function:  

EXACT  

Description:  

By default LaserQuote automatically translates explicit strings used in rules using the current locale. This function allows to bypass this mechanism and use strings as they are specified in the function  

Parameters:  

A string to use  

Example:  

IF Account.Status = EXACT(‘Final’) Then

    PROTECT Account FROM ALL

   

Function:  

GROUP_MEMBER  

Description:  

Returns true if the specified business object belongs to the specified business object group  

Parameters:  

1)     String identifying the business object

2)     String identifying the business object group  

Example:  

IF GROUP_MEMBER(‘SavingAccount’, ‘Account) = TRUE Then …

   

Function:  

LIST  

Description:  

Prints out a list of business objects as a table where each row represents a single list member. A list may be specified as an attribute or as a query string. Only specified attributes of each list member are printed out. This function is useful when it is necessary to print out a relatively small list inside a document or inside an e-mail (usually used inside a tag). Returns a table as a text string.  

Parameters:  

1.      Identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query).

2.      Delimiter to be used between attributes of a member.  

3.      Attribute names to be printed out. The name of the attribute to print out may be optionally followed by the print format (the name of the attribute and the format must be separated by comma). If format is not specified the default attribute format will be used.  

Example:  

<<LIST(Client.Children, ‘ ‘, ‘FirstName’, ‘LastName’, ‘Age,#’)>>

<<LIST(‘FIND Child WHERE Child IN Client.Children’, ‘ ‘, ‘FirstName’,’LastName’,’Age’)>>

   

Function:  

LIST_TABLE  

Description:  

Prints out a list of business objects as a table where each row represents a single list member. A list may be specified as an attribute or as a query string. Only specified attributes of each list member are printed out. The header of the table containing attribute names is printed automatically

This function can only be used inside tags in MS Word or HTML documents!  

Parameters:  

1.      Identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query).  

2.      Attribute names to be printed out. The name of the attribute to print out may be optionally followed by the print format (the name of the attribute and the format must be separated by comma). If format is not specified the default attribute format will be used.  

Example:  

<<LIST_TABLE(Client.Children, ‘FirstName’, ‘LastName’, ‘Age,#’)>>

   

Function:  

LIST_TABLE_START, LIST_TABLE_END  

Description:  

Whereas the LIST_TABLE function prints the entire table including the header, the combination of LIST_TABLE_START and LIST_TABLE_END functions allows using an existing header of the table. Just like the LIST_TABLE function it prints out members of a list of query results. However, you create the table in the document itself and only mark the start and end of the data. All tags in between the markers represent attributes to be printed (see example). LaserQuote automatically inserts extra rows as required.

These functions can only be used inside tags in MS Word, Excel or HTML documents!  

Parameters:  

LIST_TABLE_START function takes an identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query) – see LIST_TABLE function. LIST_TABLE_END has no parameters  

Example:  

Header1

Header 2

Header3

<<LIST_TABLE_START(Client.Children)>><<Child.FirstName>>

<<Child.LastName>>

<<Child.Age>><<LIST_TABLE_END()>>

 

   

Function:  

LIST_LINE  

Description:  

Prints out members of a list as a single line. Only specified attributes of each list member are printed out. A list may be specified as an attribute or as a query string. This function is useful when it is necessary to print out a relatively small list inside a document or inside an e-mail (usually used inside a tag). Returns a line as a text string.  

Parameters:  

1.      Identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query).

2.      Delimiter to be used between attributes of a member.  

3.      Delimiter to be used between members.  

4.      Attribute names to be printed out. The name of the attribute to print out may be optionally followed by the print format (the name of the attribute and the format must be separated by comma). If format is not specified the default attribute format will be used.  

Example:  

<<LIST_LINE(Client.Children,‘ ‘,’,’,‘FirstName’, ‘LastName’, ‘Age,#’)>>

   

Function:  

SUB_DOCUMENT  

Description:  

Includes a subdocument inside a master document. The source of data for the sub-document is specified as the first parameter of the function. The sub-document will be included for each instance of the business object in the data source. This function can only be used inside tags in MS Word documents!  

Parameters:  

1.      Identifier of the list or a string identifying the query (either Rule Language string or the name of the existing query). List members of business objects found by a query serve as the data source for the sub-document  

2.      Name of the document template identifying the sub-document.  

Example:  

<<SUB_DOCUMENT(Client.Children, ‘ClientList’)>>

   

Function:  

PAGE_NUMBER  

Description:  

Returns the current page number in a report  

Parameters:  

None  

Example:  

(to be used only inside the tags in the Report Designer)  

   

Function:  

NUMBER_OF_PAGES  

Description:  

Returns the number of pages in a report  

Parameters:  

None  

Example:  

(to be used only inside tags in the Report Designer)  

   

Function:  

ELEMENT_COUNT  

Description:  

Returns number of elements in a report, page, column or group (which is specified by pressing the Evaluation Details button in the Report/Presentation Designer – see Editing Tag Element)  

Parameters:  

None  

Example:  

(to be used only inside tags in the Report Designer)

   

Function:  

ELEMENT_COUNTER  

Description:  

Returns the number of an element in the report, page, column or group (which is specified by pressing the Evaluation Details button in the Report/Presentation Designer – see Editing Tag Element). For example, if Details band contains 5 elements the value of the function for the first element will be 1, the second – 2 etc.  

Parameters:  

None  

Example:  

(to be used only inside tags in the Report Designer)

   

Function:  

NESTING_LEVEL  

Description:  

Returns the level of nesting of the currently executing subreport. Master report has nesting level 0, the subreport of the master report has nesting level 1, the subreport of the subreport has nesting level 2 etc.  

Parameters:  

None  

Example:  

(to be used only inside tags in the Report Designer)

   

Function:  

URL_CONTENTS  

Description:  

Calls the specified URL and returns its response as text.  

Parameters:  

1.      URL to call  

Example:  

Object.URLContents = URL_CONTENTS(‘http://www.test.com’)  

   

Function:  

GET_CHANGES  

Description:  

If an object was changed returns which attributes have been changed as well as old and new values  

Parameters:  

Object name that has been changed  

Example:  

IF MyObject WAS CHANGED THEN  

    CREATE AuditRecord WITH AuditRecord.Description=GET_CHANGES(MyObject)  

   

 

 

   

Function:  

SCALE_IMAGE  

Description:  

Scales the given image to the specified width and height  

Parameters:  

An attribute of the picture type and two numbers representing width and height respectively  

Example:  

Object.ScaledImage = SCALE_IMAGE(Object.OrgImage, 30, 30)