You need to sign in to do that
Don't have an account?
VRK1
query help in salesforce
Hi
my requirement is i need to query
OpportunityLineItem and Resourse__c from 'Opportunity' object .
i can query OpportunityLineItem from Opportunity but not fetching 'Resource__c ' object .
**********
Select Id, Name,(Select Id,TotalPrice, PricebookEntry.ProductCode,PricebookEntry.Name,(select id,name from Resourse__c) From OpportunityLineItems) From Opportunity Where Id = 'xxxxxxxxx'
************
can you pls check and let me know how to query on opportunity and fetch both OpportunityLineItems & Resourse__c.
Thanks
VRK
my requirement is i need to query
OpportunityLineItem and Resourse__c from 'Opportunity' object .
i can query OpportunityLineItem from Opportunity but not fetching 'Resource__c ' object .
**********
Select Id, Name,(Select Id,TotalPrice, PricebookEntry.ProductCode,PricebookEntry.Name,(select id,name from Resourse__c) From OpportunityLineItems) From Opportunity Where Id = 'xxxxxxxxx'
************
can you pls check and let me know how to query on opportunity and fetch both OpportunityLineItems & Resourse__c.
Thanks
VRK
What is the relation between Opportunity and Resource. Is Resource object child of the opportunity line items .
Thanks,
Yes , Resource object is child for opportunity line items...
You cannot write a subquery inside a subquery. Instead of that you may need to write the query on Opportunity line items and get the opportunity fields using Opportunity.Name and Resourse field as sub query.
Please find the below link which helps you to understand more on it.
https://shreysharma.com/multi-level-relationships/
If this solution helps, Please mark it as best answer.
Thanks,