You need to sign in to do that
Don't have an account?
Praveen Kumar 160
Didn't understand relationship 'Case__r' in FROM part of query call.
Contact is parent and Case is child and am trying to run the following query.
Contact__c c=[Select Id, Name, (select Name from Case__r ) from Contact__c];
but query is gving me below error.
Didn't understand relationship 'Case__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.
i tried same kind of query for my another app it's working. y not here? errrrrrrrrrrrrrrrrr
Contact__c c=[Select Id, Name, (select Name from Case__r ) from Contact__c];
but query is gving me below error.
Didn't understand relationship 'Case__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.
i tried same kind of query for my another app it's working. y not here? errrrrrrrrrrrrrrrrr
List<Contact> contactList=[Select Id, Name, (select id from Cases ) from Contact];
Please read below links for more information regarding relationship queries
https://developer.salesforce.com/page/From_SQL_to_SOQL
https://developer.salesforce.com/page/A_Deeper_look_at_SOQL_and_Relationship_Queries_on_Force.com
All Answers
List<Contact> contactList=[Select Id, Name, (select id from Cases ) from Contact];
Please read below links for more information regarding relationship queries
https://developer.salesforce.com/page/From_SQL_to_SOQL
https://developer.salesforce.com/page/A_Deeper_look_at_SOQL_and_Relationship_Queries_on_Force.com
I am confused where __c and __r are exceptional.
and a lot confusion is that where to use plurals and singulars for object names.
please help me out
Hope this helps!
Case parent and Loan Applicationis child and am trying to run the following query.
public static List<Case> getCase(String agencyCode,string status,string userId)
{
List<Case> caseLists = new List<Case>();
system.debug('Inside getCase()');
caseLists = [SELECT Id,CaseNumber,Business_Unit__c,FCO_Note__c,Sub_Status__c,Agency__r.Name,Agency__r.External_Code__c,Verifier__r.Name,Reviewer__r.Name,
SCHEME_NAME__c,SCHEME_ID__c,Applicant__r.Office_Address__c,Status__c
FROM Case where Agency__r.name =:agencyCode and Status=:status and Owner.Id = :userId ];
List<Applicant__c> applicantDetails = new List<Applicant__c>();
applicantDetails = [select (select Id,CaseNumber,Business_Unit__c,FCO_Note__c,Sub_Status__c,Agency__r.Name,Agency__r.External_Code__c,Verifier__r.Name,Reviewer__r.Name,
SCHEME_NAME__c,SCHEME_ID__c,Applicant__r.Office_Address__c,Status__c
FROM Case where Agency__r.name =:agencyCode and Status=:status and Owner.Id = :userId and RecordType.DeveloperName =: IFB_ALL_GlobalConstants.CASE_RECORDTYPE_MBLPDV ORDER BY CreatedDate DESC),
(select Type__c,Line_1__c,Line_2__c,Line_3__c,Landmark__c,Pincode__c,State__c,City__c from Addresses__r where Type__c in(:GlobalConstants.ADDRESS_TYPE_OFFICE_ADDRESS,:GlobalConstants.ADDRESS_TYPE_RESIDENCE_ADDRESS ))
from Applicant__c
WHERE case__r IN : loanApplicationIds and Type__c = : GlobalConstants.APPLICANT_TYPE_APPLICANT];
Error:
The error which I am getting is "Variable does not exit" for loanapplicationId