Posts

Showing posts with the label LIKE

Salesforce Fact #833 | SOQL LIKE operator limitation on picklist values

Image
We need to be careful while using the SOQL LIKE operator on picklist values. While using LIKE operator, it considers the translated label instead of the API name of that value. In this example, we have added the translation for the account industry 'Banking' for french language. Now, when the user language is english the LIKE operator works as expected but when the user language is french, the SOQL query does not return any result. Reference:  https://salesforce.stackexchange.com/questions/285076/why-does-the-like-soql-operator-implicitly-translate-picklist-values Attached are the screenshots.

Salesforce Fact #716 | Using LIKE operator in dynamic SOQL

Image
How to use LIKE operator in dynamic SOQL? We can use a separate string variable to store the pattern part which includes the symbol '%' and use this as a bind variable or we can use extra single quotes before and after of '%'. Reference:  https://developer.salesforce.com/forums/?id=906F000000093YjIAI Attached is the screenshot.