You need to sign in to do that
Don't have an account?
jwoodall1
VF Remote Objects - multi picklist filtering
I am trying to use javascript remote objects and can't find a way to filter on a multi picklist. In SOQL, it would be an INCLUDES statement, but I don't think you can use includes in remote objects. Does anyone have an example of setting a multi select picklist value in a where clause in remote objects.
coupons.retrieve({limit: 100, where: {Brands__c: {includes: ('brand1','brand2')}}, orderby:[{Name: 'ASC'}]}, function(err, couponRecords){ //process records } //Brands__c is a multi select picklist
Please use like operator. like '%brand1%' or like '%brand2%'
Refer to this link for explanation. It enlists the operators that can be used.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_remote_objects_using_retrieve_query_object.htm
In the backend the multi-select picklists value is stored as a string - brand1;brand2.
So using like should return all those values that have the values brand1 and brand2.
Thanks,
Kaustav
Error: Error occurred while performing RETRIEVE operation on sobject: Coupon__c with data: {where={Markets__c={like=%Florida%}}} (INVALID_QUERY_FILTER_OPERATOR:
start_date__c FROM Coupon__c WHERE Markets__c like '%Florida%' LIMIT
^
ERROR at Row:1:Column:89
invalid operator on multipicklist field)
Try using: