You need to sign in to do that
Don't have an account?

Soql query error - Didn't understand relationship
Hi All,
I have 2 custom object Invoicing and Invoice details. Invoice details has a lookup relationship to Invoice. this query works fine
but i need to query 1 field from invoicing__C object also. when i try this I get the below error:
Error: Compile Error: Didn't understand relationship 'Invoiving__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name
Thanks,
Richa
I have 2 custom object Invoicing and Invoice details. Invoice details has a lookup relationship to Invoice. this query works fine
[select Date__c,company__c from invoicing_details_gen__c where invoicing__c=:invoiceId ];
but i need to query 1 field from invoicing__C object also. when i try this I get the below error:
Error: Compile Error: Didn't understand relationship 'Invoiving__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name
[select Date__c,company__c ,(select region__c from invoicing__c) from invoicing_details_gen__c where invoicing__c=:invoiceId ];How can i query this?
Thanks,
Richa
Hi Richa,
You can not use the parent object inside an inner query. Instead you can try this:
[select Date__c,company__c , invoicing__r.region__c from invoicing_details_gen__c where invoicing__c=:invoiceId ];
Thanks
FYI: region is lookup to another table wher we maintian all country ans region.
You can try this :
[Select Id, region__c, (select Date__c, company__c from invoicing_details_gen__r) from invoicing__c where id=: invoiceId];
Here (select region__c from invoicing__c) in place of invoicing__c use the custom child relationship name of this field and after that your query will be fine.
Thanks
Gyani
Mirketa Software Pvt. Ltd.
http://www.mirketa.com