SmartConnect 2018

SC SmartConnect Script Functions

SmartConnect provides the following predefined script functions:

ABS - Returns the absolute value of a decimal.
CEILING - Rounds a number up to the nearest multiple of a specified significance.
CHARACTER - Returns a character that corresponds to the supplied ASCII code.
CODE - Returns a numeric code representing the first character of the supplied string.
COMPUTERNAME - Returns the current computer name.
CONCATENATE2 - Join two text strings into one string.
CONCATENATE3 - Join three text strings into one string.
CONVERTDATETIME - Converts the date to a different time zone according to standard UTC offsets.
CURRENTDATE - Gets the current date.
DATE2JULIANDATE - Converts date to Julian date.
TODAY - Converts date to Julian date.
DAYADD - Add number of days to date.
DAYOFYEAR - Returns the number of days through the supplied date.
DAYPART - Returns the days in specified date.
DAYS360 - Returns the number of days between two dates based on a 360-day year (twelve 30-day months)
DAYSBETWEENDATES - Returns the number of days between dates.
DEC2HEX - Converts a decimal number to hexadecimal number.
DEC2OCT - Converts a decimal number to octal number.
DOLLAR - Converts number to dollar amount and rounds to specified number of places.
DURATIONTOMINUTES - Converts a timespan to minutes.
EXACTSTRINGCOMPARISON - Compares two strings for equality.  Comparison is case-sensitive.
FALSE - Returns false. Function requires trailing parenthesis.
FILEEXTENSION - Returns the extension of specified file.
FILENAME - Returns the name of specified file.
FILEPATH - Returns the path of specified file.
FIND - Returns first character position where a string first occurs within another string.  Search is case-sensitive.
FIXED - Rounds a number to the supplied precision, formats the number in decimal format, and returns the result as text.
FLOOR - Rounds a number down to the nearest multiple of a specified significance.
FORMAT - Returns a string formatted according to instructions contained in a format expression.
FORMATACCOUNTNUMBER - Gets the account index from the supplied account number in table TWO..GL00105.
FORMATACCOUNTNUMBERSTRING - Formats a given account number into the correct company string.
GPDATE - Given a DateTime, returns the date portion only, with time set to 12:00 AM, as required by Microsoft Dynamics GP.
GPTIME - Given a DateTime, returns the time portion only, with date set to 1900 01 01, as required by Microsoft Dynamics GP.
HEX2DEC - Converts a hexadecimal number to decimal.
HEX2OCT - Converts a hexadecimal number to octal.
HOUR - Returns the hour component of the specified time in 24-hour format.
INT - Rounds the specified number to the nearest integer.
ISDATE - Returns a boolean value indicating whether the expression can be converted to a date.
ISEMPTY - Returns true if value is of zero length or all spaces.
ISNA - Determines if the specified expression is not available (N/A).
ISNUMERIC - Tells if the string is numeric.
ISPOSITIVE - Determines whether the specified number is positive.
ISSTRING - Determines whether the specified object is a string.
LEFT - Returns the Left-most characters.
LEN - Returns the number of characters of the supplied string.
LENGTH - Returns the number of characters of the supplied string.
LOCAL2UTC - Converts the specified DateTime from the local timezone to UTC time,using the current windows Date & Time settings.
LOWER - Changes the characters in the specified string to lowercase characters. Numeric characters in the string are not changed.
MINUTE - Returns the minute of the specified date.
MOD - Returns the remainder after dividing a number by a specified divisor.
LASTDAYOFMONTH - Gets the date for the last day of the month.
MONTHADD - Add number of months to date.
MONTHNAME - Returns the name of the specified month with or without abbreviation.  Abbreviate values are T or F.
MONTHPART - Returns the months in specified date.
NA - Returns text of 'N/A', which represents 'Not Available'
NEGATIVESOURCE - If Number is positive or zero, return zero. If number is negative, returns the absolute value of the number.
OCT2DEC  - Converts an octal number to a decimal.
OCT2HEX - Converts an octal number to a hexadecimal.
PAD - Returns a string padded on the left or right with spaces.
POSITIVESOURCE - If the number passed is positive, return number, else return 0.
PROPER - Returns the specified string in proper-case format.
RAISE - Raises a base to a specified power.
RAND - Returns a random number between zero and one.
REPEAT - Repeats a text string the specified number of times.
REPLACE - Replaces a specified text with another string of text.
REPLACEB - Replaces text starting at a specified position.
RIGHT - Returns the rightmost characters from a given string.
ROUND - Rounds a specified number to a specified number of decimal places.
ROUNDDOWN - Rounds down a specified number to a specified number of decimal places.
ROUNDUP - Rounds Up a specified number to a specified number of decimal places.
SEARCH - Locates the position of the first character of a specified text string within another text string.
SECOND - Returns the second that corresponds to the supplied date.
SERIALFROMTEXT - Returns a serial number for the supplied text representation of date in 'yyyy/mm/dd' format.
STRIP - Returns only the requested type of characters from the text string: 'alpha', 'numeric', 'punctuation', 'whitespace'
STRIPCOMPANYNAME - Removes all punctuation and any words in following list:  Inc, Incorporated, Corp , Corporation, Co, Ltd,!, ., and ?.
STRIPPHONENUMBER - Strips the phone number to numbers only.
TEXTPART - Returns the specified number of characters from a text string, beginning with specified start position.
TODATE - Converts date in serial number format to date format.
TOSERIAL - Converts date to serial number.
TOSERIALSTRING - Converts current date to serial number in a text format.
TRIM - Removes all spaces from text except spaces between words.
TRUE - Returns true. Function requires trailing parenthesis.
TRUNC - Truncates the given number.
UPPER - Returns the text of specified string to uppercase letters.
USERNAME - Returns the username of the current user.
USPHONENUMBERFORMAT - Formats the numbers-only phone number into '(###) ####-#### Ext. ###' format.
UTC2LOCAL - Converts the specified date from UTC time to local time.
VALUE - Returns the specified text as a number.
WEEKDAY - Returns the day of week from the specified date.
WEEKDAY2 - Returns the day of week from the specified date in a serial number format.
YEAR - Returns the year from the specified date.
YEAR2 - Returns the year from the specified date in a serial number format.