1

I am obviously missing something obvious, i'm trying to execute an SOQL query in some APEX code on Salesforce but this query just doesn't work, and i can't work out why, can somebody assist?

SELECT Id,Name,Amount,R2_Job_Ref__c,R2_Shipping_Post_Code__c,Shipping_Postcode_2__c
FROM Opportunity
WHERE Shipping_Postcode_2__c != R2_Shipping_Post_Code__c AND R2_Shipping_Post_Code__c != null

Thanks!

Gareth

4

1 回答 1

2

我不相信这是可能的。

根据http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_where.htm

您必须提供本机值 - 不允许使用其他字段名称或计算。

我认为你有两个选择:

  1. 创建一个返回值的公式字段,您可以过滤该值
  2. 删除子句,然后在内存中过滤(例如循环数据并构建新数据集)
于 2013-09-13T17:02:13.580 回答