Casting as CHAR and Using Length() reports unexpected length of the CHAR
Starting with Release 24 of CRM On Demand.
Some formulas which use "CAST" and "LENGTH" function together could not generate the expected result.
Example of the issue:
Formula: LENGTH(CAST("100" as Char))
The correct answer is "3". But in R24 report, the result is returned "30".
Engineering Answer:
This is due to a setting change that was introduced in Release 24, engineering has let us know that this is now the expected behavior.
Better Explanation and Examples of how to get the expected results:
LENGTH(CAST('100' as char)) reports 30 because that is the default size. You can test this by specifying the size of the char, LENGTH(CAST('100' as char(10))) would then report 10.