+ Start a Discussion
EricBEricB 

Formula Enhancements in Winter '07

Hi Formula Authors,
Now that the Winter ’07 release is here, I wanted to alert you to some key formula enhancements in the release.  

Language changes
  • Max formula size increases from 1000 to 1300 characters.  (No change in the max compiled size limit of 4K)
  • No more curly braces on merge fields in formulas:  {!AccountName}  --> AccountName
  • Access to “global variables” in formulas: $Organization, $User (current user), $Profile (current user's profile), $UserRole (current user's role)
  • Access to Record Type field ($RecordType.Name)
New functions
  • DATEVALUE(datetime), DATEVALUE(text) – Convert a datetime field or a text field to a date field
  • FIND (start_text, text [, start_num]) - return the position of the string search_text within the string text
  • SUBSTITUTE (text, old_text, new_text) - find instances of the string old_text in the string text and replace with new_text
  • BR() – insert a line break in a text formula
  • MIN( num1, num2, num3,…) , MAX( num1, num2, num3…) – return the min or max value from the input parameters
  • New functions for validation rules: ISCHANGED (field), PRIORVALUE (field), ISNEW()
  • Advanced functions for S-Control scripting: LINKTO, URLFOR, INCLUDE, GETRECORDIDS
Other enhancements
  • HYPERLINK formulas can now use any protocol handler (e.g., "javascript:" instead of "http:")
  • IMAGE formulas now work in email and mail merge (Microsoft Word) templates
  • TEXT function now accepts datetime values as well as numeric values
Formula Editor changes
  • Field Type picklist allows selection of object (current object, $profile, $user, etc.)
  • Insert Operator is now a menu button instead of separate buttons for each operator
New uses for formula expressions
We are now leveraging our formula language in a number of new and powerful ways. 
  • Workflow field update actions (Enterprise & Unlimited Edition) - set and store field values in currency, number, percent, text, date, and date/time fields based on a formula expression
  • Validation rules - Boolean formula expressions that can prevent incorrect data from being saved
  • Default field values - initial values to be populated in fields when new records are created
  • Server-side formula expressions for S-Controls
For more details, please check out the Winter '07 Release Notes, available from the Help and Training link in the application banner.

Regards,
Eric Bezar
Platform Product Management



cluvara51cluvara51
Eric,

Any reason why when I use BR() my formula would be adding "_BR_ENCODED_" instead of an actual line break?

Here is my formula:

FirstName &" " & LastName &
BR() & Company &
BR() & Street &" " & " " &
BR() & City & " , " & State & " , " & PostalCode &
BR() & Phone &
BR() & Email

And here is the output I get:

Chris Luvara_BR_ENCODED_LuvaraAir_BR_ENCODED_112 Any Street _BR_ENCODED_Santa Clara , Ca , 95051_BR_ENCODED_(408) 555-5555_BR_ENCODED_

I am not using this as a traditional formula - I am actually using it to update a text field after a workflow rule is met. Anyway I can get around it?

Thanks,

Chris

Message Edited by cluvara51 on 01-09-2007 02:10 PM

EricBEricB
Hi Chris,
Unfortunately, the BR() function does not behave nicely in field update formulas.  The HTML generating formula functions -- BR(), HYPERLINK(), and IMAGE() -- do some fancy encoding which is normally decoded at display time.  However, with field update formulas, the results are stored directly in database fields, so the usual decoding does not occur.

Our developers are looking into the possibility of making BR() generate a new line character in field update formulas, but I'm not sure when this will be available.  In the meantime, there may be some other way to insert the appropriate escape characters yourself, but I haven't had time to research this. 

Anyone else know the secret?

Regards,
Eric Bezar
Platform Product Management


KaushikKaushik

Hi Eric

Thanks for the updates.I have some issues with loading a word document, contaning mergefields with a formula.

The final document just replaces the mergefields,but doesnot calculate  the formula

My formula is as follows

{IF{MERGEFIELD OPPURTUNITY_LINETEM_PRODUCT}= "HARDWARE","H","X"}

Could please suggest an advice,

Thanks

Kaushik

PDVPDV

Hi,

I also receicve the words BR_ENCODED when using the BR() function on field updates

Did anyone found a solution on how to insert line breaks in update field formula's?

Help would be greatly appreciated as always!

Thx

SteveSteve

Hi,

Here's a temp workaround that works.

Scrape the new line character(s) from somewhere else like the Organisation street. So if your org street currently contains something like:

xxx house, <new line>

xxx street

You can use use it in your update field formulas as follows:

address1__c  &  mid($Organization.Street , find(",", $Organization.Street )+1, 2)  & address2__c

Regards,

Steve

 

 

EricBEricB
Good news regarding the BR() function in Workflow Field Update & Default Value formulas:

We have changed the behavior so that it inserts a new line character rather than the dreaded ENCODED_BR.

You should now be able to compose formulas like

Code:
MailingStreet & BR() &
MailingCity & ", " & MailingState & " " & MailingPostalCode & BR() &
MailingCountry

 

This fix is now live, so give it a try.

Regards,
Eric

 

gireeshzgireeshz
HI, I found this post when researching an issue regarding mapping Lead fields during conversion.

when i map a formula field from a lead which uses BR() to a long text area field on the Account, I still get the 'BR ENCODED' stuff. 

Is there a way around this? 

thanks