[Sticky] INDEX: list of Proclaim Maths functions
[Sticky] INDEX: list of Proclaim Maths functions
In this post we will try and collate examples of all the maths functions available in proclaim, including the ones not found in the standard documentation.
Please post examples into the forum, and we will collate them here. Note that because of lack of documentation, you should use them at your own risk, and after consulting Eclipse!
##update 26-1-11
I'm tidying up the list of maths functions with the help of the admin - the first post will list all functions with hyperlinks to the syntax/examples for each. I will slowly fill in those functions that don't have syntax/examples.
If anyone can help me by creating syntax/examples in a new post:
reply to this thread
change the subject to the name of the function - one per reply
Please include the Proclaim version number and the source documentation (release note/manual and date) if possible.
then I will get it linked into the main list
thanks all
Please post examples into the forum, and we will collate them here. Note that because of lack of documentation, you should use them at your own risk, and after consulting Eclipse!
##update 26-1-11
I'm tidying up the list of maths functions with the help of the admin - the first post will list all functions with hyperlinks to the syntax/examples for each. I will slowly fill in those functions that don't have syntax/examples.
If anyone can help me by creating syntax/examples in a new post:
reply to this thread
change the subject to the name of the function - one per reply
Please include the Proclaim version number and the source documentation (release note/manual and date) if possible.
then I will get it linked into the main list
thanks all
Re: list of Proclaim Maths functions
ACCOUNTS-UPDATE
ADREP
ADVCONFLICTCHECK
ARCHIVE
ASC
BEGINS
CALENDAR-ENTRY
CALL-ACTION
CALL-MATHS
CDATE("dd/mm/yyyy")
CDH-REFRESHVIEW
CHR
CLEAR-GLOBAL-VARIABLES("USER")
CONFLICTCHECK
CONFLICTCHECKSTORE(correspondents, search string, function,)
CONTAINS
CLOCK
CLOSE
COPY-FILE
CREATE
CREATECASEVIEW (<username>.<caseref>,<output path>)
CURRENT
DATE
DATE-FROM-TODAY
DAY
DAYS-FROM-TODAY
DEBUG
DECODE-BASE64-STRING
DECODE-HEX-STRING
DELETE DIARIES
DELETE-FILE
DIARY AN ACTION
DMS-COPY(from file, to file)
DMS-DELETE(file)
EDIT
EXEC-SP
EXPORT
EXQUERY
EXSELECT
EXSQL
EXTERNAL-APPLICATION
EXVIEW
FETCH
FETCHQUERY/FETCHFIRST etc
FETCHRECORDAVAIL
FILE-SIZE(file)
FIND-CASE
FROMBASE64
FROMHEX
GET-MEMORY ("Memory item name")
GETDATA
GLOBAL-VARIABLE
GUID
HISTORY-SELECT
HMAC
HTTPSERVICE
IMPORT
INCOMING MAIL
INSERT
INTEREST
JSON-ARRAY-FIRST/GET-COUNT/INDEX/LAST/NEXT/PREV
JSON-GET-NAMES/PROPERTY/PROPERTY-TYPE
JSON-OBJECT/From-FILE
LAST-ACTION
LENGTH
LISTFIND
LISTITEM
LISTSIZE
LISTZIP (<zip filename>)
LMPROCESS
MAKE CALL
MD5-DIGEST
MESSAGE
MODULO or MOD
MONTH
NET
NO-REDISPLAY
NO-UPDATE
OPEN
OSGETENV
PDFBAR
POSTING
PRINT
PUSHNOTIFICATION
PUT
PUTACCOUNTS
PUTDATA
QUESTION
RANDOM
RANGE
REDISPLAY
REFRESHVIEW
RENAME-FILE
RESULT
ROUND
SCREEN
SECONDS
SELECT PRINTER
SEND ECONOMIC_DOCUMENT
SEND E-MAIL
SEND FAX
SEND LETTER
SEND MEMO
SEND SMS
SET-GLOBAL-VARIABLE
SET-VALUE
SHA1-DIGEST
SLIP
SPLIT
SQL
SQLFIRST
SQLLAST
SQLNEXT
SQLPREV
STATUS
TABLE (various)
TEXT
TIME
TIME-SECONDS
TFSCREATE
TFSATTACH
TFSUPDATE
TFSLINK
TFSGETURL
TOBASE64
TODAY
TOHEX
UNSECURE
UNZIP (<zip file name>.<folder to unzip to>)
UPDATE
USERGROUP
USERNAME
USER-PROFILE
UTCTIME
WEBFIRST
WEBLAST
WEBNEXT
WEBPREV
WEBSERVICE
WEEKDAY
WHILE
YEAR
ZIP
ADREP
ADVCONFLICTCHECK
ARCHIVE
ASC
BEGINS
CALENDAR-ENTRY
CALL-ACTION
CALL-MATHS
CDATE("dd/mm/yyyy")
CDH-REFRESHVIEW
CHR
CLEAR-GLOBAL-VARIABLES("USER")
CONFLICTCHECK
CONFLICTCHECKSTORE(correspondents, search string, function,)
CONTAINS
CLOCK
CLOSE
COPY-FILE
CREATE
CREATECASEVIEW (<username>.<caseref>,<output path>)
CURRENT
DATE
DATE-FROM-TODAY
DAY
DAYS-FROM-TODAY
DEBUG
DECODE-BASE64-STRING
DECODE-HEX-STRING
DELETE DIARIES
DELETE-FILE
DIARY AN ACTION
DMS-COPY(from file, to file)
DMS-DELETE(file)
EDIT
EXEC-SP
EXPORT
EXQUERY
EXSELECT
EXSQL
EXTERNAL-APPLICATION
EXVIEW
FETCH
FETCHQUERY/FETCHFIRST etc
FETCHRECORDAVAIL
FILE-SIZE(file)
FIND-CASE
FROMBASE64
FROMHEX
GET-MEMORY ("Memory item name")
GETDATA
GLOBAL-VARIABLE
GUID
HISTORY-SELECT
HMAC
HTTPSERVICE
IMPORT
INCOMING MAIL
INSERT
INTEREST
JSON-ARRAY-FIRST/GET-COUNT/INDEX/LAST/NEXT/PREV
JSON-GET-NAMES/PROPERTY/PROPERTY-TYPE
JSON-OBJECT/From-FILE
LAST-ACTION
LENGTH
LISTFIND
LISTITEM
LISTSIZE
LISTZIP (<zip filename>)
LMPROCESS
MAKE CALL
MD5-DIGEST
MESSAGE
MODULO or MOD
MONTH
NET
NO-REDISPLAY
NO-UPDATE
OPEN
OSGETENV
PDFBAR
POSTING
PUSHNOTIFICATION
PUT
PUTACCOUNTS
PUTDATA
QUESTION
RANDOM
RANGE
REDISPLAY
REFRESHVIEW
RENAME-FILE
RESULT
ROUND
SCREEN
SECONDS
SELECT PRINTER
SEND ECONOMIC_DOCUMENT
SEND E-MAIL
SEND FAX
SEND LETTER
SEND MEMO
SEND SMS
SET-GLOBAL-VARIABLE
SET-VALUE
SHA1-DIGEST
SLIP
SPLIT
SQL
SQLFIRST
SQLLAST
SQLNEXT
SQLPREV
STATUS
TABLE (various)
TEXT
TIME
TIME-SECONDS
TFSCREATE
TFSATTACH
TFSUPDATE
TFSLINK
TFSGETURL
TOBASE64
TODAY
TOHEX
UNSECURE
UNZIP (<zip file name>.<folder to unzip to>)
UPDATE
USERGROUP
USERNAME
USER-PROFILE
UTCTIME
WEBFIRST
WEBLAST
WEBNEXT
WEBPREV
WEBSERVICE
WEEKDAY
WHILE
YEAR
ZIP
LAST-ACTION
LAST-ACTION
Use this maths in the AFTER section of a master document letter template to programatically determine the correspondent for future use.
Code: Select all
MESSAGE( LAST-ACTION )
vdc = LAST-ACTION
vdd = LISTITEM( vdc , 3 , "$" )
MESSAGE( vdd )
CALL-MATHS
CALL-MATHS (caseref,"Maths Field name")
run a maths item on any file
notes - not sure of the behaviour of case locking/PUT commands if you run maths on a file not locked to yourself. The maths field name needs to be enclosed not by curly brackets, but by "", and excluding the .Text ending. This command is useful for running a case-less SQL autoroutine that updates numerous other cases from one central autoroutine
WARNING: when searching for where database fields are used via Database Maintenance, the search results will NOT show the maths fields specified in CALL-MATHS. You will have to do a text string search via MATHS SEARCH
Example code:
run a maths item on any file
notes - not sure of the behaviour of case locking/PUT commands if you run maths on a file not locked to yourself. The maths field name needs to be enclosed not by curly brackets, but by "", and excluding the .Text ending. This command is useful for running a case-less SQL autoroutine that updates numerous other cases from one central autoroutine
WARNING: when searching for where database fields are used via Database Maintenance, the search results will NOT show the maths fields specified in CALL-MATHS. You will have to do a text string search via MATHS SEARCH
Example code:
Code: Select all
#run a maths field on a target case to update it with statistics
#our maths field when added with field chooser is {M update statistics.Text}
v-case = {Statistics file link.link case ref}
#TODO need to lock target case to ourselves here
CALL-MATHS (v-case, "M update statistics")
CALL-ACTION
CALL-ACTION (caseref,"Linked Action Code")
as per CALL-MATHS, but replace with the name of a linked action
as per CALL-MATHS, but replace with the name of a linked action
PUTDATA
PUTDATA(caseref,{target field},value-to-put)
CAUTION: when using the "Maths Search", the code overview displays TWO opening brackets and only one close bracket. This does not reflect the underlying maths field content.
As above, useful for PUTting data to another case in the same claimtype you are currently working with, and for use in loops to update many child cases from one case-less autoroutine.
Example:
CAUTION: when using the "Maths Search", the code overview displays TWO opening brackets and only one close bracket. This does not reflect the underlying maths field content.
As above, useful for PUTting data to another case in the same claimtype you are currently working with, and for use in loops to update many child cases from one case-less autoroutine.
Example:
Code: Select all
#src 1-12-11
#PUT a value into a list of cases returned by a SQL search within the same claimtype
#1 - run SQL to return list of cases
#2 - use WHILE loop to iterate through the cases
#3 - use PUTDATA() to update each case with a fixed value
#-----
#define our static value we want to add to each case0
v-value = "TEST"
#run SQL to get the list of cases we want to update. Here we have previously made an SQL called "ALLFILES"
SQL("ALLFILES","")
#jump to first case returned by SQL
SQLFIRST
#set up our loop to iterate through all cases returned, until no more
WHILE return-value <> "?" DO
#check case isn't locked
v-case = return-value
STATUS (v-case)
IF return-value = "available" then
OPEN (v-case,"LOCK")
PUTDATA(v-case,{Test text field.Text},v-value)
UPDATE (v-case,"UNLOCK")
ELSE
message ("case ", v-case," locked - can't update")
END
#advance to next case
SQLNEXT
END
ASC (char)
ASC (char)
converts a character into ascii code
useful for checking for invalid characters in input fields
converts a character into ascii code
useful for checking for invalid characters in input fields
Code: Select all
#initialise variable for holding output
v-out = ""
#retrieve field that needs checking
v-in = {Accident Description.Text}
#how many characters in it
v-in-len = LENGTH( v-in )
#loop over each character, if the character is not a-z or A-Z then replace it with a space
i = 0
WHILE i < v-in-len DO
i = i + 1
#get one character at a time
v-char = SPLIT( v-in , i , 1 )
#convert into ascii code
v-asc = ASC( v-char )
#IF A-Z then do nothing
IF v-asc >= 65 AND v-asc <= 90 THEN
#A-Z - do nothing
#if a-z then do nothing
ELSEIF v-asc >= 97 AND v-asc <= 122 THEN
#a-z - do nothing
ELSE
#not a valid char. replace with space
v-char = " "
END
#build output
v-out = TEXT( v-out ) + v-char
END
result = v-out
-
- Posts: 11
- Joined: Thu Jan 02, 2014 3:00 pm
- Has thanked: 8 times
- Been thanked: 1 time
CONFLICTCHECK
(Taken from Release Notes V3.2.11)
There is the ability to do a Conflict Check via a linked action Math command while in a case.
When the linked action is ran it will search for the correspondent if one exists and display the conflict results.
This is setup using the Math syntax below:
CONFLICTCHECK (<correspondent type>,<search text>)
The two parameters can either be in the form of merge fields or text/fixed values.
Any further syntax needed, i.e. PUT commands to indicate whether a check has been carried out, can be added as normal.
Please note that the correspondent type needs to be in speech marks, e.g.
Code: Select all
CONFLICTCHECK ( "ALL" , {Client.Name} )
The Syntax Check does not pick this up.
There is the ability to do a Conflict Check via a linked action Math command while in a case.
When the linked action is ran it will search for the correspondent if one exists and display the conflict results.
This is setup using the Math syntax below:
CONFLICTCHECK (<correspondent type>,<search text>)
The two parameters can either be in the form of merge fields or text/fixed values.
Any further syntax needed, i.e. PUT commands to indicate whether a check has been carried out, can be added as normal.
Please note that the correspondent type needs to be in speech marks, e.g.
Code: Select all
CONFLICTCHECK ( "ALL" , {Client.Name} )
The Syntax Check does not pick this up.
Re: LAST-ACTION
update Nov 2014steve wrote:LAST-ACTIONUse this maths in the AFTER section of a master document letter template to programatically determine the correspondent for future use.Code: Select all
MESSAGE( LAST-ACTION ) vdc = LAST-ACTION vdd = LISTITEM( vdc , 3 , "$" ) MESSAGE( vdd )
LAST-ACTION works fine for the AFTER maths of a document/memo created in MCH, but the last action is not updated with any actions called by Proclaim maths.
It only list actions performed in Main Case Handling.
e.g.:
Code: Select all
#send memo
SEND MEMO (001) TO (CLIENT) COST UNITS (1/00) DETAIL (test) CASE (CURRENT-CASE)
#query LAST ACTION - this fails to return the details of the above SEND MEMO
message (LAST-ACTION)
The alternative would be to use FETCH in this circumstance.