Skip to main content 3 月 5 日~ 6 日にサンフランシスコで開催される TDX (Salesforce+ でも配信) で「Developer Conference for the AI Agent Era (AI エージェント時代に向けた開発者向けカンファレンス)」にぜひご参加ください。お申し込みはこちら
エラー

問題が発生しました。もう一度お試しください。

Bryan Jimenez が「#Apex」で質問
Hi,

I am new to apex and I need a little help with an error that will not go away.

 

public class ClientRelationshipController {

Public List<Prospect__c> getProspects() {

List<Prospect__c> Prospects=[Select Name,Property__c,Property_Name__c,Phone__c,Mobile__c,Prospect_Score__c,Email__c

From Prospect__c

Where Created_Date__c = Today And Relationship_Lead__c != :Relationship_lead_ID__c

And RecordType__c = 'Prospect'];

return Prospects;

}

}

Thank you,

Bryan
1 件の回答
  1. 2016年4月12日 23:23
    Hy Bryan.

    You did not specify the error you're getting, but I'm assuming this is related to your SOQL query. 

    Salesforce doesn't allow direct field to field comparison in SOQL query.

    You can create a formula field for this:

     Formula Name: myFormula:

    IF(Prospect__c.Relationship_lead_ID__c != Prospect__c.Relationship_Lead__c , 'true', 'false')

    Final SOQL:

    List<Prospect__c> Prospects=[Select Name,Property__c,Property_Name__c,Phone__c,Mobile__c,Prospect_Score__c,Email__c

    From Prospect__c

    Where Created_Date__c = Today And myFormula = 'true'

    And RecordType__c = 'Prospect'];

    http://help.salesforce.com/HTViewSolution?id=000187460

     
0/9000