You need to sign in to do that
Don't have an account?
learn_sfdc
how to identify relationship between two objects
Hi,
How to get query and relationship between two objects(standard and custom)
i have below details
standard object - case
custom object - product version
TESTCase = [Select
c.AccountId,
c.Account.Type,
c.RecordTypeId
from Case c where Id= :ViewingCase.Id];
how do i include product version object fields in to above query.
Thanks
How to get query and relationship between two objects(standard and custom)
i have below details
standard object - case
custom object - product version
TESTCase = [Select
c.AccountId,
c.Account.Type,
c.RecordTypeId
from Case c where Id= :ViewingCase.Id];
how do i include product version object fields in to above query.
Thanks
It does'n work... its throwing error - Compile Error: Didn't understand relationship
- May I request you please check the salesforce documentation on "SOQL Relationship Queries" check below link.
- https://developer.salesforce.com/blogs/developer-relations/2013/05/basic-soql-relationship-queries.html
Basic Examples of SOQL RELATIONSHIPS:Child > Parent (Standard Object)
Selectid,Account.Name,Account.Phone,Account.industry,Account.Type,Account.Rating,Account.website,Account.Ownership,Account.AnnualRevenue,Account.NumberOfEmployees,Account.CleanStatus from Contact
Child >Parent(Custom Object)
Selectid,COLLEGE__r.Name,COLLEGE__r.Contact__c,COLLEGE__r.Count__c,COLLEGE__r.Highest_Marks__c,COLLEGE__r.Address__cfrom Studnt__c
Parent >Child(Standard object)
select Name, Industry, (select AssistantName, Email from contacts)from ACCOUNT
Parent >Child (Custom Object)
1select id,Name,
(select Studnt__c.name__c from Studnts__r) from College__C
I hope it will be helpful.
BestRegards
RahulKumar
go to fields of case and find Productversion lookup field and open its definition and find child relationship name. and append __r at the end of it and use this name instead of productversion__r
Case is a child of productversion.
in case object i have a field productversion_test and its linked as lookup to product version