Every once in a while, I come across a “feature” in Salesforce that really forces me to scratch my head.

In today’s WTF moment, I was working with a client on a screen flow. We needed to add a lookup component, to allow users to select one or more contacts.

In screen flows, lookup components require you to enter the name of an object that has the same lookup field. For example, if you want to lookup contacts, then the usual suspect is Opportunity.[ContactId]. The screenflow also displays the helptext associated with this field, which can be helpful.

When building the flow today, the placeholder for the lookup component displayed “Search undefined…” when I expected it to say, “Search Contacts…”

A quick Google search revealed how to make this happen. The answer will SHOCK you! (lol)

According to Salesforce, this “bug” is actually a feature. “During run time, the lookup component displays ‘Search undefined…’ if the lookup field defined in Field API Name isn’t on an assigned page layout. To display the correct text, add the defined lookup field to all of the source object’s page layouts that are assigned to running users.”

Can someone please point me to the engineer who thought this was a good idea? Why TF do I need to add a field to a page layout in order for it to display correctly in a screen flow?!

The takeaway
As a good enough consultant, it’s OK not to know everything about Salesforce. It’s quite OK to perform a Google search while sharing your screen with a client. And it’s definitely OK to wonder aloud why Salesforce can be quirky sometimes.

Category:
Salesforce