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
Arjun AccentureArjun Accenture 

can some on eplease tell me what is issue with this query ??

select id,OwnerId,Territory_ID__c, Patient__c.Territory_ID__r.Current_TM1_Assignee__c from Patient__c where OwnerId !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c =: OwnerId


it is saying "unknow error parsing query"
Ginny MahantGinny Mahant
select id, 
OwnerId,
Territory_ID__c, 
Patient__c.Territory_ID__r.Current_TM1_Assignee__c 
 from Patient__c 
 where OwnerId != Null AND 
Patient__c.Territory_ID__r.Current_TM1_Assignee__c != Null AND 
Patient__c.Territory_ID__r.Current_TM1_Assignee__c = OwnerId
Arpit Jain7Arpit Jain7
Are you trying to run this query in developer console, If so update OwnerId in end with any hardcoded user ID you want to query like below :

select id,OwnerId,Territory_ID__c, Patient__c.Territory_ID__r.Current_TM1_Assignee__c from Patient__c where OwnerId !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c !=Null AND Patient__c.Territory_ID__r.Current_TM1_Assignee__c ='00511111111'

Let me know for any questions.

Thanks
Arpit
 
Big EarsBig Ears
Arjun,

Do you need to replace the "Patient__c.Territory_ID__r.Current_TM1_Assignee__c" with "Patient__r.Territory_ID__r.Current_TM1_Assignee__c"?

In fact, anywhere where Patient__c is linking to a parent record, it may need to be Patient__r