Activity Forums Salesforce® Discussions ORs and ANDs in the retrieve function of Visualforce Remote Objects

  • ORs and ANDs in the retrieve function of Visualforce Remote Objects

  • Piyush

    Member
    April 30, 2016 at 5:36 pm

    How do I specify an or of one field's value? For instance, how do I build a query for an account where (BillingState is any of (Hawaii, Alaska, or California)) and (Name is like % Assoc%)?

    The obvious answer (below) does not work, because JS engines will simply use the last value for BillingState ({ eq: 'California'}):

  • Himanshu

    Member
    May 27, 2016 at 11:45 am

    Hi Piyush,

    Try this code:-

    where: {
    or: {
    BillingState: { eq: 'Hawaii' },
    or: {
    BillingState: { eq: 'Alaska' },
    or: {...},
    },
    },
    Name: { like: '% Assoc%' }
    }

Viewing 1 - 2 of 2 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos