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

SOQL Subquery
Hi all,
I am getting the following error any one please help me to solve
expenseList = [Select id,
Name,
Doctors_Met__c,
station__c,
Month_Year_Combination__c,
Chemist_Met__c,
( select id,frommarket__c,tomarket__C,Fare__c from Expense_Fares__r)
from Expense__c ];
Error: ManageExpenseStatementController Compile Error: Didn't understand relationship 'Expense_Fares__r' 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. Please reference your WSDL or the describe call for the appropriate names. at line 100 column 21 |
Expecting Expense_Fares is plural and Child to Expense Object
if not check it once ...
Error msg suggesting to check those things
thanks for quick reply
I have given plural name only
Hi linganna,
you need to use the child relationship name instead of lookup field API.
Thanks,
Javed
Hi Linganna
try this
expenseList = [Select id,
Name,
Doctors_Met__c,
station__c,
Month_Year_Combination__c,
Chemist_Met__c,
( select id,frommarket__c,tomarket__C,Fare__c from Expense_Fares__c)
from Expense__c ];