Using the picker control with a SalesForce SmartObject returns an error when setting the filter to a non-text property
KB003566
PRODUCT
When you use the picker control on a view and associate it with a SalesForce SmartObject, the control returns an error containing "LIKE" when you set the filter to use a non-text property like ID.
Symptoms
For example, after you set the filter for the picker control to use the ID property in SalesForce, you see an error like this when using the control:
Error: [field]__c FROM [entity] WHERE (Id LIKE '%value%' OR Name LIKE '%value%') ^ ERROR at Row:1:Column:929 invalid operator on id field
Issue
The issue occurs because the Salesforce API does not support using 'like' with non-text fields such as ID. This is a known issue in the SalesForce APIs, see the following articles for more information:
- https://salesforce.stackexchange.com/questions/8351/is-there-any-way-to-filter-a-soql-or-sosl-query-on-the-id-field
- https://apps.support.sap.com/sap/support/knowledge/public/en/1977803#:~:text=When%20using%20the%20operator%3A%20%22Like,that%20are%20not%20ID%20field.
- https://developer.salesforce.com/docs/atlas.en-us.226.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm
Workaround
Behind the scenes, the way that the picker control builds up the filter statement results in a LIKE query, e.g. WHERE ID LIKE '%value%' If possible, adjust the filter used for the picker control to use a text property, instead of a non-text property.