Super Clone Pro
Action Formula List Options

The Action Formula List is a basic formula engine that can be used to set field values. It is a hybrid of our original formula logic and new formula engine.

Both original and new formula keywords can be used together, but it is important to understand the difference in how they assign the field a value. The original formula logic included commands that applied to the value of the field, and each command was separated by a comma. The new formula engine uses a more Salesforce like formula syntax, and the results of the formula replace the value of the field.

Value References

  • FIELD(field_name) – within the parenthesis, specify an API field name of another field on the object being cloned
  • PARENTFIELD(field_name) – within the parenthesis, specify an API field name of a field from the direct parent object in the configured hierarchy
  • URLPARAM(parameter_name) – reference a URL parameter key within the parameters to retrieve the value for a formula.
    • Example:  URLPARAM(url_key_name)

Special Keywords

  • >> – Actions following this symbol will be performed after the save button is pressed. This is often useful when using the clone multiplier feature because it will allow each of the cloned hierarchies to have fields with different values using the !index and !mult action formula list keywords.
    • Example to allow a user to enter a start date on the confirmation page, and then assign another field the value of start date plus 1 month.
      • >>,ADDMONTHS(FIELD(Start_Date__c), 1)
  • !index – When using the clone multiplier feature, this is the sequence number of the hierarchy being cloned.
  • !mult – When using the clone multiplier feature, this is the total number of cloned hierarchies requested.

Conditional Logic

Basic expressions can be used by using ternary conditional syntax. The syntax consists of an express followed by a question mark (?), and then results for true and results for false separated by a colon(:). Conditions can be nested for more complex expressions.

  • true ? “trueResult” : “falseResult”
  • field(MyField__c) == “Option1” ? “first” : “second”
  • field(MyField__c) == “Option1” ? 1 : (field(MyField__c) == “Option2” ? 2 : 0)

Text Functions

Text constants in the functions must be enclosed in double quotes.

  • Concatenation can be done using quoted strings or value references connected with a plus sign.
    • Example prefix and suffix a value in a field:
      • “the prefix: ” + FIELD(Custom_Text__c) + ” the suffix”
  • BEGINS(text, compare_text) – returns true if the beginning of the text matches the compare text
  • CONTAINS(text, compare_text) – returns true if the compare text is found anywhere in the string
  • PRE(text) – Prefixes a specified value on the field. Text constants must be in double quotes.
    • Legacy keyword: prefixes the current value of the field
  • SUF(text) – Suffixes a specified value on the field. Text constants must be in double quotes.
    • Legacy keyword: suffixes the current value of the field
  • INCLUDES(text, compare_text) – returns true if a pick list contains the compare text value
  • UPPER(text) – returns the text string in uppercase
  • LOWER(text) – returns the text string in lowercase
  • MID(text, start_num, num_chars) – returns a section of the string
  • FIND(search_text, text[, start_num]) – returns an integer index where the search text begins
  • LEFT(text, num_chars) – returns the left number of characters of a text string
  • RIGHT(text, num_chars) – returns the right number of characters of a text string

Number Functions

  • The new formula syntax can accept math operators like + – * /
    • Examples of adding numbers:
      • FIELD(My_Number__c) + 100
      • FIELD(My_Number__c) + FIELD(Additional__c)
  • ADD(number) – Adds the specified value to the field.
    • Legacy keyword: adds to the current value of the field
  • SUB(number) – Subtracts the specified value from the field.
    • Legacy keyword: subtracts from the current value of the field
  • MUL(number) – Multiplies the specified value to the field.
    • Legacy keyword: multiplies the current value of the field
  • DIV(number) – Divides the field value by the specified value.
    • Legacy keyword: divides the current value of the field

Date / Datetime Functions

The date functions expect an input of a date or datetime value. This is passed to the function using FIELD() or PARENTFIELD() as the first parameter.

The following example will add 5 years to the My_Custom_Date__c. The value will be assigned to the field the formula is configured on. ADDYEARS(FIELD(My_Custom_Date__c), 5)

  • ADDYEARS(date, num) – Adds years to the value passed within the parenthesis
  • ADDMONTHS(date, num) – Adds monthsto the value passed within the parenthesis
  • ADDDAYS(date, num [, SKIP_DAY_KEYWORD]) – Adds days to the value passed within the parenthesis
    • Specific days of the week can be skipped using the following keywords in a comma separated list: SKIPMON, SKIPTUE, SKIPWED, SKIPTHU, SKIPFRI, SKIPSAT, SKIPSUN
    • Example skip Saturday and Sundays:
      • ADDDAYS(+10, SKIPSAT, SKIPSUN)
  • ADDHOURS(datetime, num) – Adds hours to the value passed within the parenthesis
  • ADDMINUTES(datetime, num) – Adds minutes to the value passed within the parenthesis
  • ADDSECONDS(datetime, num) – Adds seconds to the value passed within the parenthesis
  • FINDPRIORDAYOFWEEK(date, DAY_KEYWORD) – Finds the previous requested day of the week.
    • Use keywords to specify the day of the week: DAYMON, DAYTUE, DAYWED, DAYTHU, DAYFRI, DAYSAT, DAYSUN
    • Example find the prior Monday given a date:
      • FINDPRIORDAYOFWEEK(FIELD(My_Custom_Date__c), DAYMON)
    • If given Thursday January 4, 2024, this would return Monday January 1, 2024
  • FINDNEXTDAYOFWEEK(date, DAY_KEYWORD) – Finds the next requested day of the week
    • Use keywords to specify the day of the week: DAYMON, DAYTUE, DAYWED, DAYTHU, DAYFRI, DAYSAT, DAYSUN
    • Example find the next Monday given a date:
      • FINDNEXTDAYOFWEEK(FIELD(My_Custom_Date__c), DAYMON)
    • If given Thursday January 4, 2024, this would return Monday January 8, 2024
  • ISDAYOFWEEK(date, DAY_KEYWORD) – Returns true or false if the date passed to the function is one of the dates specified. Multiple days of the week can be specified by separating them with a comma.
    • Use keywords to specify the day of the week: DAYMON, DAYTUE, DAYWED, DAYTHU, DAYFRI, DAYSAT, DAYSUN
    • Example to set the date to the nearest Monday if it is set on a weekend:
      • ISDAYOFWEEK(Field(My_Start_Date__c), DAYSAT, DAYSUN) ? FINDNEXTDAYOFWEEK(FIELD(My_Start_Date__c), DAYMON) : FIELD(My_Start_Date__c)

Legacy Date / Datetime Functions

  • CUR – Set the current date or date time.
  • LDM – Using the current value of the field, set the field value to the last day of that month

The legacy date/datetime functions below adjust the value of the field currently in the field. Using a “+” will add to the value, using a “-” will reduce the value, and no plus/minus will set the value.

Example: y(2024) will set the year to 2024
Example: y(+5) will add 5 years to the current date/datetime field value
Example: y(-5) will subtract 5 years from the current date/datetime field value

  • y( ) – Set the year, add years, or subtract years.
  • m( ) – Set the month, add months, or subtract months.
  • d( [, SKIP DAYS OF THE WEEK]) – Set the day, add days, or subtract days.
    • Specific days of the week can be skipped using the following keywords in a comma separated list: SKIPMON, SKIPTUE, SKIPWED, SKIPTHU, SKIPFRI, SKIPSAT, SKIPSUN
    • Example skip Saturday and Sundays: d(+10, SKIPSAT, SKIPSUN)
  • hr( ) – Set the hour, add hours, or subtract hours.
  • mn( ) – Set the minute, add minutes, or subtract minutes.
  • s( ) – Set the second, add seconds, or seconds.

Keyword For Copy Functionality Between Different Object Types

Copy a custom Item object from an Opportunity to a Quote using the RELATIONSHIPID() keyword.

  • The custom Item object would need to have relationships to both the Opportunity and Quote.
  • The configuration would be created on the Opportunity.
  • The formula action “RELATIONSHIPID(CLEAR)” would be used on the lookup reference field to the Quote.
  • The copy page would be loaded with an “rid” URL parameter of the Quote record Id, and a “fromid” URL parameter of the Opportunity record Id.
  • To keep the reference to the Opportunity in the relationship field, the keyword “RELATIONSHIPID(fromid)” could be used.
  • The automatic copy of custom items could also be run from Process Builder on the creation of a Quote.