function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sf consultant.ax380sf consultant.ax380 

Web Services API / Soql / Child to parent / or clause no results ret w/o 2nd half of or clause rs ok

Use the web services api

Maybe I'm just not understanding soql after years of using actual SQL. :)  How can statement 1 (with or clause)below return 0 records while statement 2 (no or clause) returns records???  It's an "or" clause.. I'm not getting it!!

I would think no matter what the 2nd 1/2 of the or clause evals to the 1st part should still return me some records.
A cut and paste of the soql (with the or clause) into eclipse in the schema browser IS returning records.. I'm even more perplexed now.

The email parm is the same passed in both statements.The obect being evalued is the junction table in a many to many relationship.

binding.service.soap_address = https://www.salesforce.com/services/Soap/c/14.0

Someone please stop my madness and help!!! LOL

Code:
        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'"
            +    "    or         KBDocSubscription_Parent__r.Contact__r.email like '" + email + "%'";

        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'";
.....
res = binding.query(soql);
.....

 

        
sf consultant.ax380sf consultant.ax380
I think I solved my one problem.. despite the fact I was seeing v14.0 in the debugger I found that I was calling

Code:
serverUrl = https://cs2.salesforce.com/services/Soap/c/11.1
URL uri = new URL(serverUrl);               
binding = (SoapBindingStub) new SforceServiceLocator().getSoap(uri);


when changed to 14.0
ie. 
serverUrl =https://cs2.salesforce.com/services/Soap/c/14.0

I then received results back from the query with the or clause.



Thanks me!! :)