Maybe I am missing something obvious here, but I have a new error when searching within a lookup field after upgrading to the latest Brooklyn release (9.5.5) in a sandbox. Production is still on version 8.13 (I know, I’m very behind the times and have been scolded) and is not having this error.
Lookup is to the Contact object, which is the parent to the custom object record being entered. When I start typing something in the auto-complete lookup field, I get the following SOQL error:
An error occurred while attempting to perform the following SOQL query: SELECT Name,FirstName,LastName,Birthdate,Current_Age__c,Sex__c,Ethnicity__c,Primary_Language__c,Id FROM Contact WHERE ((RecordType.DeveloperName != ‘Staff’))AND(((Name LIKE ‘%test%’)OR(FirstName LIKE ‘%test%’)OR(LastName LIKE ‘%test%’)OR(Current_Age__c LIKE ‘%test%’))) ORDER BY Name LIMIT 51 Error:like operator only valid on string field
Current_Age__c is a numeric formula field. I am not sure why the SOQL would be attempting to search on this field. It does not appear to be doing so in production. The XML for this field is below. The XML is the same in sandbox and production and was generated from the page builder UI (and not manually modified).
Thank you for any help with this!
<field id="Contact__c" showhelp="true" valuehalign="" type="" optionsource="" displaytemplate="{{Name}} • {{#Birthdate}}DOB {{Birthdate}}{{/Birthdate}}{{^Birthdate}}iunknown DOB]{{/Birthdate}}" searchtemplate="{{Name}} • {{#Birthdate}}DOB {{Birthdate}}{{/Birthdate}}{{^Birthdate}}/unknown DOB]{{/Birthdate}}{{#Current_Age__c}} • Age {{Current_Age__c}}{{/Current_Age__c}} • {{#Sex__c}}{{Sex__c}}{{/Sex__c}}{{^Sex__c}}Sunknown gender]{{/Sex__c}} • {{#Ethnicity__c}}{{Ethnicity__c}}{{/Ethnicity__c}}{{^Ethnicity__c}}/unknown race/ethnicity]{{/Ethnicity__c}}"> <label>Look up client/contact</label>
<searchfields>
<searchfield query="true" return="true" show="false" field="Name" operator="contains"/>
<searchfield query="true" return="true" show="true" field="FirstName" operator="contains"/>
<searchfield query="true" return="true" show="true" field="LastName" operator="contains"/>
<searchfield query="true" return="true" show="true" field="Birthdate"/>
<searchfield query="true" return="true" show="true" field="Current_Age__c"/>
<searchfield query="false" return="true" show="true" field="Sex__c" operator="contains"/>
<searchfield query="false" return="true" show="true" field="Ethnicity__c" operator="contains"/>
<searchfield query="false" return="true" show="true" field="Primary_Language__c" operator="contains"/>
</searchfields>
<filters>
<filter type="fieldvalue" operator="!=" enclosevalueinquotes="true" field="RecordType.DeveloperName" value="Staff"/>
</filters>
</field>