it seems like the formulas are being added to the ...
# general
m
it seems like the formulas are being added to the result set before ‘evaluation’ and can produce an accurate result in the search context.
j
yep, ran in to this exact thing in sandbox today. formula works in the search but not in a dynamic field.
k
This is often because the fields dont exist because the record hasn't been saved
m
sure that can happen. in this case, it’s a field that’s available as a search column that isn’t actually available in the formula field ‘picker’ for the field default value. it’s not actually a huge deal i don’t think. it’s just interesting that the formula is getting passed through to the search rather than the error.
could certainly present a significant issue if people got confused i guess, but in my case it was just disturbing.
k
I'm curious... what fields?
m
i have a bunch of examples, but this transaction line example is the easiest one. it’s a dynamic field that concatenates {line} and {number} values. throws an error in the UI, resolves in searches.
(to be clear, this is not my thing. some contractor built a bunch of fields this way. lots of errors on the forms in the UI, but the searches that consume them all look fancy. )
k
Interesting. Im not sure I see the point of that field, without more context, but it makes sense why it doesnt work in the UI but does in searches
m
the field itself is mostly irrelevant, but it definitely doesn’t make sense to me. it’s more significant to me that the behavior is different between the UI and the search and it seems that presents a reasonable risk. there are cases where the result could be non-null and differ between the contexts and there’s (effectively) no way to know it’s happening without inspection.
{type}
is an example. you can probably imagine formulas that return “relevant” results that differ solely by context. (CASE, DECODE, NVL all come to mind). i maintain a general paranoia around anything where a user can receive conflicting information from what they should be able to ‘trust’. it’s certainly an edge case, and at least in my situation, it’s easy to avoid. so … ¯\_(ツ)_/¯
k
All I was saying In the example you sent... there is a line reference. Within the user interface there is no line reference to be had but in searches that works because the lines are stored. Im sure this is for a variety of reasons but the one that sticks out to me the most is the chance that someone might insert a line between existing lines.