Field Name | Description |
Title | This displays the title of the formula. The title is editable. In the edit mode, the title is pre-populated. |
Description | This displays the description of the formula used. The description is editable. |
Target Object | This displays the name of the Target Object based on which the formula is configured. |
Target Field | This displays the name of the Target Field based on which the formula is configured. |
Cancel | This allows you to disassociate the current formula. |
Save | This allows you to save a formula. |
Delete | This allows you to delete a formula in the edit mode. |
The fields that are part of the formula are stored in the Related Info field of the configuration record. A field may or may not be added to the page layout for formulas to be executed on Web Delivery. |
Function Signature | Description | Example |
IF (logical_test, value_if_true, value_if_false) | Checks whether a condition is true and returns one value if TRUE and another value if FALSE. | Target Field: Work Order > Billing Type Requirement: Leave Billing Type unchanged if Customer Down is checked; else, set it to Paid. Formula: $F.IF($F.EQUAL($D.Work_Order.SVMXC__Customer_Down__c,'true'), $D.Work_Order.SVMXC__Billing_Type__c, 'Paid') |
AND (logical1,logical2,..) | Checks whether all arguments are true and returns TRUE if all arguments are true | Target Field: Work Order > Billing Type Requirement: Leave Billing Type unchanged if Customer Down is checked AND Order Status is Open AND Order Type is Field Service; else, set it to Paid. Formula: $F.IF($F.AND($F.EQUAL($D.Work_Order.SVMXC__Customer_Down__c, 'true'), $F.EQUAL($D.Work_Order.SVMXC__Order_Status__c, 'Open'), $F.EQUAL($D.Work_Order.SVMXC__Order_Type__c, 'Field Service')), $D.Work_Order.SVMXC__Billing_Type__c, 'Paid') |
OR (logical1,logical2,..) | Checks whether any of the arguments are true and returns TRUE or FALSE. Returns FALSE only if all arguments are false | Target Field: Work Order > Billing Type Requirement: Leave Billing Type unchanged if Customer Down is checked OR Priority is High OR Is PM Work Order is checked; else, set it to Paid. Formula: $F.IF($F.OR($F.EQUAL($D.Work_Order.SVMXC__Customer_Down__c, 'true'), $F.EQUAL($D.Work_Order.SVMXC__Priority__c, 'High'), $F.EQUAL($D.Work_Order.SVMXC__Is_PM_Work_Order__c, 'true')), $D.Work_Order.SVMXC__Billing_Type__c, 'Paid') |
NOT (logical) | Changes FALSE to TRUE or TRUE to FALSE | Target Field: Work Order > Order Type Requirement: Set Order Type to Depot Repair if City is not Los Angeles and Is PM Work Order is not checked; else, leave Order Type unchanged. Formula: $F.IF($F.NOT($F.OR($F.EQUAL($D.Work_Order.SVMXC__City__c,'Los Angeles'), $F.EQUAL($D.Work_Order.SVMXC__Is_PM_Work_Order__c, 'true'))), 'Depot Repair', $D.Work_Order.SVMXC__Order_Type__c) |
NULL | Clears the field value | Configure this literal on any target field to clear its value. Formula: $F.SETNULL() |
Function Signature | Description | Example |
TODAY() | Returns the current date in logged user's time zone when used with a date field. Returns 12 AM on current date (logged in user's time zone) when used with a datetime field. When this value is assigned to a text type field, the format of the returned value is yyyy-MM-dd. | Target Field: Work Order > Scheduled Date Requirement: Set Scheduled Date to today. Formula: $F.TODAY() |
NOW() | Returns the datetime in logged in user's time zone, representing the current moment. When the returned value is assigned to a text type field, the format of the returned value is yyyy-MM-dd HH:mm:ss, in logged in user's time zone. | Target Field: Work Order > Actual Onsite Response Requirement: Set Actual Onsite Response to now. Formula: $F.NOW() |
DATE(year,month,day) | Creates a date from year, month and day, where all are numeric values / fields, with year being specified as a 4-digit number. When the returned value is assigned to a text type field, the format of the returned value is yyyy-MM-dd. | Target Field: Work Order > Next Scheduled Date (custom field) Requirement: Set Next Scheduled Date to 1st day of the created month in next year. Formula: $F.DATE($F.YEAR($D.Work_Order.CreatedDate)+1, $F.MONTH($D.Work_Order.CreatedDate), 1) |
DATEVALUE(expression) | Creates a date in the logged in user's time zone, from its datetime or text representation. When the argument is a string / text field, the expected format is yyyy-MM-dd HH:mm:ss or yyyy-MM-dd in the logged in user's time zone, for date and datetime values, respectively. | Target Field: Work Detail (Labor) > Start Date (custom field) Requirement: Set Start Date to the date part of Start Date and Time field. Formula: $F.DATEVALUE($D.Labor.SVMXC__Start_Date_and_Time__c) |
DATETIMEVALUE(expression) | Creates a datetime in the logged in user's time zone, from its date or text representation. If the argument is a date, 12 AM in the logged in user's time zone is considered as the time to create the datetime value. When the argument is a string / text field, the expected format is yyyy-MM-dd HH:mm:ss or yyyy-MM-dd in the logged in user's time zone, for date and datetime values, respectively. | Target Field: Work Order > Next Scheduled Date Time (custom field) Requirement: Set Next Scheduled Date Time to 12 AM on the 1st day of the created month in next year. Formula: $F.DATETIMEVALUE($F.DATE($F.YEAR($D.Work_Order.CreatedDate)+1, $F.MONTH($D.Work_Order.CreatedDate), 1)) |
DATEDIFF(date1,date2,option) | Returns the difference between two date or datetime fields in days/weeks/months/years. The value returned is negative if value2 is greater than value1. unit_of_difference must be INDAYS, INWEEKS, INMONTHS, or INYEARS. The returned number can be set as the value of a text type field also. | Target Field: Work Order > Initial To Completion Days (custom field) Requirement: Difference in days from Actual Initial Response to Completed Date Time Formula: $F.DATEDIFF($D.Work_Order.SVMXC__Completed_Date_Time__c, $D.Work_Order.SVMXC__Actual_Initial_Response__c, 'INDAYS') |
DAY(date or datetime) | Returns the day of the month, a number between 1 and 31, for the date or datetime value argument passed. The returned number can be set as the value of a text type field also. | Target Field: Work Detail (Labor) > Activity Day (custom field) Requirement: Set Activity Day to the day of the month of Start Date and Time field. Formula: $F.DAY($D.Labor.SVMXC__Start_Date_and_Time__c) |
MONTH(date or datetime) | Returns the month, a number between 1 (January) and 12 (December), for the date or datetime value argument passed. The returned number can be set as the value of a text type field also. | Target Field: Work Detail (Labor) > Activity Month (custom field) Requirement: Set Activity Month to the day of the month of Start Date and Time field. Formula: $F.MONTH($D.Labor.SVMXC__Start_Date_and_Time__c)$F.Add($F.DAY($D.Labor.SVMXC__Start_Date_and_ Time__c),1) |
YEAR(date or datetime) | Returns the year of a date, a number between 1900 and 9999, for the date or datetime value argument passed. The returned number can be set as the value of a text type field also. | Target Field: Work Detail (Labor) > Activity Year (custom field) Requirement: Set Activity Year to the day of the month of Start Date and Time field. Formula: $F.YEAR($D.Labor.SVMXC__Start_Date_and_Time__c) |
Function Signature | Description | Example |
EQUAL(value1,value2) | Compares the two arguments and returns TRUE if they are the same. Returns FALSE if they are different. The field type of the arguments must be the same. | Target Field: Work Order > Order Type Requirement: If City is San Jose, set Order Type to Depot Repair; else, leave Order Type unchanged. Formula: $F.IF($F.EQUAL($D.Work_Order.SVMXC__City__c,'San Jose'), 'Depot Repair', $D.Work_Order.SVMXC__Order_Type__c) |
NOTEQUAL(value1, value2) | Returns the datetime in logged in user's time zone, representing the current moment. When the returned value is assigned to a text type field, the format of the returned value is yyyy-MM-dd HH:mm:ss, in logged in user's time zone. | Target Field: Work Order > Order Type Requirement: If City is not Los Angeles, set Order Type to Depot Repair; else, leave Order Type unchanged. Formula: $F.IF($F.NOTEQUAL($D.Work_Order.SVMXC__City__c,'Los Angeles'), 'Depot Repair', $D.Work_Order.SVMXC__Order_Type__c) |
LESSTHAN(value1, value2) | Compares the two arguments and returns TRUE if value1 is less than value2. Returns FALSE if value1 is equal to or greater than value2. The field type of the arguments must be the same. | Target Field: Work Detail (Labor) > Discounted Line Price (custom field) Requirement: If Discounted Line Price is less than 10.45, set it to 10.45; else, leave Discounted Line Price unchanged. Formula: $F.IF($F.LESSTHAN($D.Labor.Discounted_Line_Price__c, 10.45), 10.45, $D.Labor.Discounted_Line_Price__c) |
LESSTHANEQUAL(value1, value2) | Compares the two arguments and returns TRUE if value1 is less than or equal to value2. Returns FALSE if value1 is greater than value2. The field type of the arguments must be the same. | Target Field: Work Detail (Labor) > Discounted Line Price (custom field) Requirement: If Discounted Line Price is less than or equal to 10.4, set it to 10.5; else, leave Discounted Line Price unchanged. Formula: $F.IF($F.LESSTHANEQUAL($D.Labor.Discounted_Line_Price__c, 10.4), 10.5, $D.Labor.Discounted_Line_Price__c) |
GREATERTHAN(value1, value2) | Compares the two arguments and returns TRUE if value1 is greater than value2. Returns FALSE if value1 is equal to or less than value2. The field type of the arguments must be the same. | Target Field: Work Detail (Labor) > Discounted Line Price (custom field) Requirement: If Discounted Line Price is greater than 100, set it to 100; else, leave Discounted Line Price unchanged. Formula: $F.IF($F.GREATERTHAN($D.Labor.Discounted_Line_Price__c, 100), 100, $D.Labor.Discounted_Line_Price__c) |
GREATERTHANEQUAL(value1, value2) | Compares the two arguments and returns TRUE if value1 is greater than or equal to value2. Returns FALSE if value1 is less than value2. The field type of the arguments must be the same. | Target Field: Work Detail (Labor) > Discounted Line Price (custom field) Requirement: If Discounted Line Price is greater than or equal to 100, set it to 99; else, leave Discounted Line Price unchanged. Formula: $F.IF($F.GREATERTHANEQUAL($D.Labor.Discounted_Line_Price__c, 100), 99, $D.Labor.Discounted_Line_Price__c) |
Function Signature | Description | Example |
ADD(value1, value2) | Adds two numeric values. The values are numbers or field identifiers of numeric fields (number, currency, percent). | Target Field: Work Order > Total Parts Labor Price (custom field) Requirement: Set Total Parts Labor Price to the sum of Total Parts Price and Total Labor Price (both custom Work Order fields). Formula: $F.ADD($D.Work_Order.Total_Parts_Price__c, $D.Work_Order.Total_Labor_Price__c) |
SUBTRACT(value1, value2) | Subtracts value2 from value1. The values are numbers or field identifiers of numeric fields (number, currency, percent). | Target Field: Work Order > Total Parts Labor Price (custom field) Requirement: Subtract 5 from Total Parts Labor Price. Formula: $F.SUBTRACT($D.Work_Order.Total_Parts_Labor_Price__c, 5) |
MULTIPLY(value1, value2) | Multiplies value1 by value2. The values are numbers or field identifiers of numeric fields (number, currency, percent). | Target Field: Work Detail (Labor) > Calculated Line Price (custom field) Requirement: Set Calculated Line Price to Line Price Per Unit * Line Qty Formula: $F.MULTIPLY($D.Labor.SVMXC__Actual_Quantity2__c, $D. Labor.SVMXC__Actual_Price2__c) |
DIVIDE((value1, value2)) | Divides the dividend by divisor (dividend / divisor). The values are numbers or field identifiers of numeric fields (number, currency, percent). | Target Field: Work Detail (Labor) > Calculated Line Price (custom field) Requirement: Set Calculated Line Price to half of its value. Formula: $F.DIVIDE($D.Labor.Calculated_Line_Price__c, 2) |
Function Signature | Description | Example |
SUMOF(lines_section_identifier, '<field_API_name>') | Returns the sum of all the numbers in the given list of numbers. The numbers are identified by the API name of the field and the list is identified by the lines section identifier. Numbers include currency and percent field types also. | Target Field: Work Order > Total Parts Price (custom field) Requirement: Set Total Parts Price to the sum of Discounted Line Price (custom field) of all the Parts lines section records. Formula: $F.SUMOF($D.Parts, ‘Discounted_Line_Price__c’) |
AVGOF(lines_section_identifier, '<field_API_name>') | Returns the average of all the numbers in the given list of numbers. The numbers are identified by the API name of the field and the list is identified by the lines section identifier. Numbers include currency and percent field types also. | Target Field: Work Order > Average Parts Price (custom field) Requirement: Set Average Parts Price to the average of Discounted Line Price (custom field) of all the Parts lines section records. Formula: $F.AVGOF($D.Parts, ‘Discounted_Line_Price__c’) |
MINOF(lines_section_identifier, '<field_API_name>') | Returns the minimum of all the numbers in the given list of numbers. The numbers are identified by the API name of the field and the list is identified by the lines section identifier. Numbers include currency and percent field types also. | Target Field: Work Order > Minimum Parts Price (custom field) Requirement: Set Minimum Parts Price to the minimum of Discounted Line Price (custom field) of all the Parts lines section records. Formula: $F.MINOF($D.Parts, ‘Discounted_Line_Price__c’) |
MAXOF(lines_section_identifier, '<field_API_name>') | Returns the maximum of all the numbers in the given list of numbers. The numbers are identified by the API name of the field and the list is identified by the lines section identifier. Numbers include currency and percent field types also. | Target Field: Work Order > Maximum Parts Price (custom field) Requirement: Set Maximum Parts Price to the maximum of Discounted Line Price (custom field) of all the Parts lines section records. Formula: $F.MAXOF($D.Parts, ‘Discounted_Line_Price__c’) |
For Math and Rollup functions, any field with blank values is considered as zero. |
Function Signature | Description |
Check box | EQUAL, NOTEQUAL, LESSTHAN, LESSTHANEQUAL, GREATERTHAN, GREATHANEQUAL |
Currency | EQUAL, NOTEQUAL |
Date | EQUAL, NOTEQUAL |
Date/Time | EQUAL, NOTEQUAL |
Email | EQUAL, NOTEQUAL |
Number | EQUAL, NOTEQUAL, LESSTHAN, LESSTHANEQUAL, GREATERTHAN, GREATHANEQUAL |
Percent | EQUAL, NOTEQUAL |
Phone | EQUAL, NOTEQUAL |
Picklist | EQUAL, NOTEQUAL |
Picklist (Multi-Select) | EQUAL, NOTEQUAL |
Text | EQUAL, NOTEQUAL, LESSTHAN, LESSTHANEQUAL, GREATERTHAN, GREATHANEQUAL |
Text Area | EQUAL, NOTEQUAL, LESSTHAN, LESSTHANEQUAL, GREATERTHAN, GREATHANEQUAL |
Long Text Area | EQUAL, NOTEQUAL, LESSTHAN, LESSTHANEQUAL, GREATERTHAN, GREATHANEQUAL |
URL | EQUAL, NOTEQUAL |