Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

We are using Jitterbit to query records from Salesforce, but we are running into an issue. In the query condition statement, I am comparing two fields from the Salesforce table. When I go to test the query, it gives me the error "Bind variables only allowed in Apex Code [MALFORMED QUERY]".

Here is an example of the query:

SELECT Id FROM Price_Agreement_Item__c WHERE Approved_Date__c > Last_Upload_Date__c

The fields Approved_Date__c and Last_Upload_Date__c are both contained in Salesforce table Price_Agreement_Item__c. How does one create a SOQL statement that conditions the select statement comparing two fields in the table?

Any help is appreciated.

Thank you in advance.

1 Answer

0 votes
by (32.1k points)

SOQL doesn't currently support direct field to field comparison in WHERE clauses. The Soap API also does not allow the 'IN' clause in SOQL queries. It's stupid, but then again, that's 95% of Salesforce.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...