Select Page

Function Reference

To help you implement your business processes in Microsoft Dynamics CRM we have over 160 functions in North52 Business Process Activities and are adding more all the time. If you find something we don’t do please lets us know and we’ll add it to our roadmap.

Client Side Functions

Function Description
AddCustomView(‘controlname’, ‘entitylogicalname’, ‘nameofview’, ‘FetchXml’, ‘LayoutXml’, ‘isDefault’) Provides the ability to add a custom view to a lookup control.
Alert(‘message’) Presents a pop-up alert to the user.
AlertClear(‘message’, ‘fieldname’) Presents a pop-up alert to the user and clears the listed fields.
ClearFields(‘fieldname’) Clears the contents of any fields.
ClearControlNotification(‘fieldname’) Clears the control notification for the specified field name. CRM 2013 Updated entities only.
ClearFormNotification(‘uniqueID’) Clears the form notification for the specified uniqueID. CRM 2013 Updated entities only.
DisableFields(‘fieldname’) Disables one or more fields on a form.
EnableFields(‘fieldname’) Enables one or more fields on a form.
ExecuteDialog(‘dialogname’) Executes a dialog.
ExecuteWorkflow(‘workflowname’) Executes a workflow.
HideFields(‘fieldname’) Hides one or more fields on a form.
HideLeftHandNavItems(‘navname’) Hides one or more left hand navigation items.
HideSections(‘tabname.sectionname’) Hides one or more sections on a form.
HideTabs(‘tabname’) Hides one or more tabs on a form.
SetClientSideDate(‘date’) Set a date on the client side.
SetClientSideLookup(‘entityname’, ‘guid’, ‘Primary Field Text’) Sets a lookup on the client side.
SetControlNotification(‘fieldname’, ‘message’) Sets the control notification. CRM 2013 Updated entities only.
SetFocus(‘fieldname’) Set the focus on a field.
SetFormNotification(‘message’,’level’,’uniqueID’) Sets the form notification. CRM 2013 Updated entities only.
SetRequiredFields(‘fieldname’) Sets one or more fields to be required.
SetNotRequiredFields(‘fieldname’) Sets one or more fields to be not required.
SetPicklistValues() Sets the available picklist values.
ShowFields(‘fieldname’) Shows one or more fields on a form.
ShowLeftHandNavItems(‘navname’) Shows one or more left hand navigation items.
ShowSections(‘tabname.sectionname’) Shows one or more sections on a form.
ShowTabs(‘tabname’) Shows one or more tabs on a form.

^ back to top

Convert Functions

Function Description
CDecimal(‘stringvalue’) Returns a decimal which is the conversation of the ‘stringvalue’ from a string to a decimal.
CDouble(‘stringvalue’) Returns a double which is the conversation of the ‘stringvalue’ from a string to a double.
CInt32(‘stringvalue’) Returns a int 32 which is the conversation of the ‘stringvalue’ from a string to a int.
CInt64(‘stringvalue’) Returns a int 64 which is the conversation of the ‘stringvalue’ from a string to a int.
ToString(‘valuetoconvert’, ‘format’) Returns a string representation of any number, decimal, currency or boolean value. An optional format may also be applied.

^ back to top

Date Functions

Function Description
AddDays(‘datetime’, numberofdays) Returns a date which is calculated by adding the numberofdays parameter to the given date.
AddHours(‘datetime’, numberofhours) Returns a date which is calculated by adding the numberofhours parameter to the given date.
AddMonths(‘datetime’, numberofmonths) Returns a date which is calculated by adding the numberofmonths parameter to the given date.
AddYears(‘datetime’, numberofyears) Returns a date which is calculated by adding the numberofyears parameter to the given date.
CreateDate(‘year’,’month’,’day’,’hour’,’minute’,’second’,’millisecond’) Returns a date (UTC) given a set of inputs.
DateDiff(‘fromdate’, ‘todate’, ‘interval’) Calculate the difference in time between 2 dates for a specified interval.
DateDiffElapsed(‘fromdate’, ‘todate’, ‘interval’) Calculate the elapsed difference in time between 2 dates for a specified interval.
DateDiffDescription(‘fromdate’, ‘todate’, ‘interval’) Calculate the elapsed description difference in time between 2 dates for a specified interval.
DiffWorkingDays(‘startdate’, ‘enddate’) Returns the number of working days between two dates.
GetDateOnly(‘datetime’) Returns the date only part of a datetime.
GetDay(‘datetime’) Returns the day part of a datetime.
GetMonth(‘datetime’) Returns the month part of a datetime.
GetNextWorkingDay(‘startdate’) Returns the next working day given a date to start from.
GetNextWorkingTime(‘startdate’, useBusinessCalendar, ‘DayStartTime’, ‘DayEndTime’, ‘NumberOfMins’) Returns the next working time given a date to start from and a number of minutes to increment by.
GetYear(‘datetime’) Returns the year part of a datetime.
GetWeek(‘datetime’) Returns the week number for the specified date. The week number will be as defined by the ISO 8601 standard.
GetWeekElapsed(‘datetime’) Returns the elapsed week number for the specified date.
IsWorkingDay(‘datetocheck’) Returns true if the passed date is a working day.
LocalDate() Returns the current date for the timezone that is set for the requesting user.
LocalDateTime() Returns the current date and time for the timezone that is set for the requesting user.
LocalTimeFromUtcTime(‘datetime’) Returns the date and time given a UTC datetime for the timezone that is set for the requesting user.
UtcDate() Returns the current UTC date.
UtcDateTime() Returns the current UTC date and time.
UtcTimeFromLocalTime(‘datetime’) Returns the current UTC time given a date and time that is local to a specified user.

^ back to top

Find Functions

Function Description
FindAvg(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns the average value of the ‘outputfieldname’ for the records specified by the input parameters.
FindCount(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns the number of records specified by the input parameters.
FindListValues(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘recordcount’) Finds a comma separated list of values on an entity based on 1 input field.
FindMax(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns the maximum value of the ‘outputfieldname’ for the records specified by the input parameters.
FindMin(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns the minimum value of the ‘outputfieldname’ for the records specified by the input parameters.
FindRecords(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns a collection of records which can be used in-conjunction with the ForEachRecord() function.
FindRecordsFetchXml(‘fetchxml’) Returns a collection of records which can be used in-conjunction with the ForEachRecord() function.
FindSum(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’, ‘defaultvalue’) Returns the Sum of the ‘outputfieldname’ for the records specified by the input parameters.
FindValue(‘entitylogicalname’, ‘inputfieldname’, ‘inputfieldvalue’, ‘outputfieldname’,’defaultvalue’) Finds a value in any property on any entity based on 1 input field.

^ back to top

Localization Functions

Function Description
GetAttributeDisplayName(‘entitylogicalname.attributelogicalname’) Returns the localized string name for the attribute defined by ‘entitylogicalname.attributelogicalname’ based on the language settings for the current user.
GetOptionSetName(‘entitylogicalname.attributelogicalname’, optionsetvalue) Returns the localized string name for the optionset defined by ‘entitylogicalname.attributelogicalname’ and optionsetvalue based on the language settings for the current user.

^ back to top

Logical Functions

Function Description
Case Builds a case statement which can evaluate multiple conditions.
DoLoop Allows you to loop a specified number of times and perform an action.
if(expression, true, false) Builds an if statement
In(‘valuetofind’,’item1′, ‘item2’, ‘item3’) Returns true a value is found within the set of values.
Let Allows you to set variables and return a value.
NoOp Used as part of an if statement to indicate ‘No Operation’ i.e. do nothing.
Or, And, +, -, *, /, %, !, !=, >, < Listing of standard logical operators.

^ back to top

Math Functions

Function Description
Abs(value) Returns the absolute value of a specified number.
Ceiling(value) Rounds a number up to the nearest integer.
Exp(value) Returns a value for e raised to the power of a number you specify.
Floor(value) Returns a number rounded down to the nearest integer.
Pow(value, power) Returns a specified number raised to the specified power.
Round(value, digitprecision) Rounds a value to the nearest number or specified number of digits.
Sign(value) It returns -1 when the numeric value is negative; it returns 0 if the numeric value is zero; and it returns 1 if the numeric value is positive.
Sqrt(value) Returns the square root of a specified number.
Truncate(value) Returns the integral digits of the specified Decimal; any fractional digits are discarded.

^ back to top

Query Operators

Function Description
Avg(‘FormulaDetail.Property’) Returns the average for a number, decimal or currency field that is defined as part of a Formula Detail (FetchXml) query.
Count(‘FormulaDetail.Property’) Returns the number of records as defined by the Formula Detail (FetchXml) query.
DisplayMultipleRecords(‘FormulaDetail’) Returns a formatted string which displays the name and value of each column defined in the Formula Detail (FetchXml) query.
FirstRecord(‘FormulaDetail.Property’) Returns the first row that is defined by the result set of a Formula Detail (FetchXml) query.
ForEachRecord(GetRecordsFD(‘FormulaDetailQueryName’), ‘action’) Iterates over a set of records and performs an action
LastRecord(‘FormulaDetail.Property’) Returns the last row that is defined by the result set of a Formula Detail (FetchXml) query.
Max(‘FormulaDetail.Property’) Returns the maximun value for a number, decimal or currency field that is defined as part of a Formula Detail (FetchXml) query.
Min(‘FormulaDetail.Property’) Returns the minimum for a number, decimal or currency field that is defined as part of a Formula Detail (FetchXml) query.
Sum(‘FormulaDetail.Property’) Returns the sum for a number, decimal or currency field that is defined as part of a Formula Detail (FetchXml) query.

^ back to top

Platform Operations

Function Description
AssociateEntities(‘entityNameLeft’, ‘entityLeftGuid’, ‘entityNameRight’, ‘entityRightGuid’, ‘relationshipName’) Creates a M:M relationship between 2 records.
CreateRecord(‘entityname’, 1, SetAttribute(‘attributename’, ‘attributevalue’ ) Creates a record within the system.
CreateNote(‘title’, ‘regardingentityname’, ‘regardingentityid’, ‘note’) Creates a note within the system.
DeleteRecord(‘entityname’, ‘guid’) Deletes a record.
DisassociateEntities(‘entityNameLeft’, ‘entityLeftGuid’, ‘entityNameRight’, ‘entityRightGuid’, ‘relationshipName’) Removes a M:M relationship between 2 records.
ExecuteWorkflow(‘workflowname’, ‘recordid’) Executes a workflow.
StartSchedule(‘schedulename’) Starts the schedule for the specified name.
StopSchedule(‘schedulename’) Stops the schedule for the specified name.
UpdateActivityPartyBulk(‘ActivityPartyCollection’, ‘activitypartytype’, ‘attributename.attributevalue’) Bulk updates all activity parties in a collection.
UpdateRecord(‘entityname’, ‘primarykeyid’, SetAttribute(‘attributename’, ‘attributevalue’ ) Updates a record within the system.

^ back to top

Regular Expression Functions

Function Description
RegexMatch(‘string’, ‘regex’) Searches the specified ‘string’ for the first occurrence of the regular expression specified in the ‘regex’ parameter.
RegexIsMatch(‘string’, ‘regex’) Returns true if the defined ‘regex’ pattern has a match within the specified ‘string’ else false.
RegexReplace(‘string’, ‘regextofind’, ‘regextoreplace’) Returns a string which is the ‘string’ but replaces all regex matches of ‘regextofind’ with ‘regextoreplace’.

^ back to top

Set Native Fields

Function Description
GetPartyListItemId(‘partylist’, index) Gets a party record id from a partylist.
GetPartyListItemType(‘partylist’, index) Gets a party record type from a partylist.
GetPartyListItemName(‘partylist’, index) Gets a party record name from a partylist.
GetPartyListCount(‘partylist’) Gets the count of the number of parties in a party list.
SetCustomerLookup(‘entityname’, ‘guid’, ‘Primary Field Text’) Sets the target property of a formula when it is of type customer.
SetLookup(‘guid’) Sets the target property of a formula when it is of type lookup.
SetOwnerTeam(‘guid’) Sets the owner field of a record to a team represented by the guid.
SetOwnerUser(‘guid’) Sets the owner field of a record to a user represented by the guid.
SetPartyList(‘entityname’,’guidentity’,’guidentity’) Sets values for a field of type Party List.
SetPartyListCombined(SetPartyList(‘entityname’,’guidentity’,’guidentity’), SetPartyList(‘entityname’,’guidentity’,’guidentity’)) Combines multiple SetPartList to a single combined list.
SetRegardingLookup(‘entityname’, ‘guid’, ‘Primary Field Text’) Sets the target property of a formula when it is of type lookup but is a regarding field.
SetState(state,status) Sets the state and status of a record within Dynamics CRM.

^ back to top

String Functions

Function Description
Base64Encode(‘inputstring’) Returns a Base64 encoding of a string.
Base64Decode(‘inputstring’) Returns a Base64 decoding of a string.
Capitalize(‘inputstring’) Capitalize the first letter in a string.
Contains(‘inputstring’, ‘stringtofind’) Returns true if the ‘stringtofind’ is found in the ‘string’ parameter.
Compress(‘inputstring’) Returns a compressed string.
CountCharacters(‘inputstring’) Returns the number of characters that make up a string.
Decompress(‘inputstring’) Returns a decompressed string.
EndsWith(‘inputstring’, ‘endstring’) Returns true if one string ends with another.
IndexOf(‘inputstring’, ‘stringtofind’, startindex) Returns the position in ‘string’ where the first instance on ‘stringtofind’ was located starting at a position of ‘startindex’ in the ‘string paremeter.
Insert(‘inputstring’, position, ‘insertstring’) Inserts one string into another at a position.
Left(‘inputstring’, numberofcharacters) Returns the left number of characters in a string.
Lower(‘inputstring’) Converts all string elements to lower case.
MD5(‘inputstring’) Returns a MD5 hash of a string.
PadLeft(‘inputstring’, totalLength, ‘charToPad’) Puts a number of string characters to the left of an input string based on overall length.
PadRight(‘inputstring’, totalLength, ‘charToPad’) Puts a number of string characters to the right of an input string based on overall length.
Replace(‘inputstring’, ‘stringtofind’, ‘stringtoreplace’) Replaces one string with another one given an input string
Remove(‘inputstring’, startpostion, numberofcharacterstoremove) Removes a number of characters from a string at a starting position.
Right(‘inputstring’, numberofcharacters) Returns the right number of characters in a string.
Reverse(‘inputstring’) Reverse the contents of a string.
Slice(‘inputstring’, ‘start’, ‘end’) Returns a substring from a string between a start and end position.
Split(‘inputstring’, ‘chartosplit’, ‘index’) Returns a substring based on a split character and index.
StartsWith(‘inputstring’, ‘startstring’) Returns true if one string starts with another.
StringFormat(‘inputstring’, param[0],param[1],param[n]) Takes a string and inserts the values with the params when it run.
Substring(‘inputstring’, startposition, length) Returns part of the input string based on a start position and length.
Upper(‘inputstring’) Converts all string elements to upper case.
ToString(‘valuetoconvert’, ‘format’) Returns a string representation of any number, decimal, currency or boolean value. An optional format may also be applied.
ToTitleCase(‘inputstring’) Converts the first character of a word to uppercase and the rest to lower case.
Trim(‘inputstring’, param[0],param[1],param[n]) Removes all occurrences of a set of specified characters from the beginning and end of the string.

^ back to top

System Functions

Function Description
AutoNumber(‘autonumberstring’) Returns a value which has been incremented by a defined formula.
Clear() Sets the target property of a formula to a null value.
ChainFunctions(‘entityname.propertyname’, ‘functioncall’, ‘functioncall’ ) Allows you to chain functions together.
Clone(‘entityname’, ‘guidofentity’, ‘relationshipname’) Clones a record.
ContainsData(‘fieldtocheck’) Returns true if ‘fieldtocheck’ contains data.
DoesNotContainData(‘fieldtocheck’) Returns true if ‘fieldtocheck’ does not contain data.
GetUserRoles(‘userid’) Returns a comma separated list of a user’s roles.
Random(minvalue, maxvalue) Returns a random integer between the supplied min and max values.
RemoveAttribute() Removes the attribute specified in the target property from the current operation.
SetCurrencySymbol(‘Value’, ‘CurrencySymbol’) Sets the currency symbol on a money\decimal field.
WhoAmI() Returns a GUID representing the current user.

^ back to top

Web Services

Function Description
GeoCodeBing(‘addressLine’, ‘locality’, ‘adminDistrict’, ‘postalCode’, ‘countryRegion’) Returns the latitude and longitude of the given address. Powered by Microsoft.
GetExchangeRate(‘from’, ‘to’) Returns the exchange rate between 2 currencies. Powered by Open Exchange Rates.
Translate(‘text’, ‘to’, ‘from’) Returns the translation of the given text. Powered by Microsoft.

^ back to top

Fuzzy Matching

Function Description
DamerauLevenshteinDistance(‘inputstring1’, ‘inputstring2’) Computes the Damerau Levenshtein Distance Distance between 2 strings.
LevenshteinDistance(‘inputstring1’, ‘inputstring2’) Computes the Levenshtein Distance between 2 strings. Used for fuzzy matching.
Metaphone3(‘inputstring’) Returns a phonetic ‘sounds like’ encoding of a string.
Similarity(‘inputstring1’, ‘inputstring2’, ‘distance’) Returns a percentage of how alike 2 strings are given the distance between.

^ back to top