0

I have an external object from which I want to retrieve certain values avoiding some other ones depending on certain conditions.

The problem is that when I apply the NOT IN filter like in the following

SELECT Id, VALUE__c, DESCRIPTION__c, FROM ZSDFMarcolor__x WHERE VALUE__c NOT IN :valuesToAvoidLIST

It doesn't work and I can see that query is getting me the same values I specify not to retrieve.

Is this some kind of bug or unexpected behavior with external objects? Because I haven't worked that much with them and I don't know what to do.

Regards,

7
  • Have you tried to check if valuesToAvoidLIST is populated correctly? or if the query is fetching the same results when you hardcode the values in the query like NOT IN ('value1', 'value2')?
    – arut
    Jul 15, 2022 at 8:54
  • Hi @arut Yes I tried fetching the variable and also hardcoring the values but still not working
    – molinet
    Jul 15, 2022 at 9:01
  • Checked the doc but do not see "NOT IN" listed under unsupported operators. I'm trying to repro this in my org and will let you know how it goes. Jul 15, 2022 at 12:18
  • 1
    Is there a need for escaping characters in valuesToAvoidLIST (refer this)? Also, are you seeing the same behavior when querying fields other than VALUE__c?
    – arut
    Jul 15, 2022 at 13:48
  • 1
    Hi @Swetha. The external data source type is 'Salesforce Connect: Custom—Vigience_Dev.EnterpriseGateway'. I've also tried using AND Field__c != 'value' for each value but still not working as expected. I'll open a SF case as soon as my PM allows me to but thanks for all your help!
    – molinet
    Jul 18, 2022 at 6:36

0

You must log in to answer this question.

Browse other questions tagged .