CynoteckLabs / CTK-LightningComponentSupport

Provide support space for Lightning Components Support
0 stars 0 forks source link

Filters - Contains instead of Equals #12

Closed LingChong83 closed 3 months ago

LingChong83 commented 3 months ago

Hello!

This is working for me except I need to use "Contains" statements instead of "Equals", or multiple equals statements.

I have a List View which is currently filtered by:-

accountId = '[id]' and Subject = 'NB Phone Meeting'

However, I need it to also capture Subject = 'NB Live Meeting', so basically the list view is filtered/shows by the Account ID and only when the Subject contains NB Meeting.

Is there a way of doing this? Apologies as I am not a developer and have zero SOQL experience. I have tried the below and different variations but cannot get it to work:-

accountId = '[id]' and Subject = 'NB Phone Meeting' OR 'NB Live Meeting'

Thanks!

mk8837 commented 3 months ago

Hi @LingChong83 ,

Noticed a minor issue with your filter for using multiple equal statements. You might want to try this instead: accountId = '[id]' AND (Subject = 'NB Phone Meeting' OR Subject ='NB Live Meeting') Please let us know if this resolves the issue for you.

toanshulverma commented 3 months ago

@LingChong83 : You may want to look at using Like operator (Refer: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_comparisonoperators.htm)

For example: accountId = '[id]' and Subject LIKE 'NB%Meeting'

toanshulverma commented 3 months ago

Closing this ticket, as there's no action needed for component.