Have you ever had the need to put static text on a Salesforce screen without going to the work of creating a custom VisualForce page all for a simple instruction?
Hot Tip: Use a formula field.
Typically we think using of formula fields for, well, formulas as in calculations. Maybe adding adding up some numbers, echoing information from a parent object, or translating obscure values into text.
That’s all good. But you can also set a formula to just be a text string in quotes. When you do the text just shows on screen wherever you place it.
I bet you’re thinking, that’s kinda clever, but when would I need it?
Maybe…You want to put instructions on screen that relate to something important, complex or unintuitive that’s going on.
Or maybe you need to collect answers to long, precisely worded questions. The key word here being long. You’ve probably bumped into Salesforce’s limited number of characters in a field name. If you must put a longer question on screen that Salesforce allows in a field name, you can use this trick then make the answer a separate field next to the question.
How you do it is actually quite simple…When you create your formula field, just enter the text you want in quotes.
What’s the rub? Well – there’s one and it makes things admittedly a bit hokey. The approach only works if you’re viewing the record or doing in-line editing by double clicking on a field from a record’s view mode. This is because edit mode doesn’t show formula fields all of this text vanishes so creating new records requires that you create and immediately save then use in-line editing.
Creating a new record is kinda useless
But after you hit Save and go to inline-edit the record (double click on any answer field) it becomes much more useful.