You need to sign in to do that
Don't have an account?
lijin Dev
Please help me add one more entity using SOQL
Hello Team,
I want to add one more field to the below SOQL. This field "Name" is coming from a different Entity. Not sure how can I go about this
Field to add: Name , Table: TBC_Verticals__c
SELECT Name,
(SELECT UnitPrice FROM OpportunitylineItems) ,
(SELECT Revenue__c FROM Opportunity_Line_Item_facts__r) ,
FROM opportunity
I want to add one more field to the below SOQL. This field "Name" is coming from a different Entity. Not sure how can I go about this
Field to add: Name , Table: TBC_Verticals__c
SELECT Name,
(SELECT UnitPrice FROM OpportunitylineItems) ,
(SELECT Revenue__c FROM Opportunity_Line_Item_facts__r) ,
FROM opportunity
They are connected just by the ID's that is a text field (i hope).
All Answers
Else, you need to find a way to determine connection between the two tables.
Hope this is helpfull!!
Thanks,
Gaurav
Skype: Gaurav62990
TBC_verticals__c has a field "ID" which will be connected to Vertical_ID__C in Opportunity.
so, here the relationship would go like this:
1. Query TBC_Verticals objects 2. Now query Opportunity filtering based on TBC Id's
Hope this helps
Thanks,
Gaurav
Skype: Gaurav62990
As it is confirmed that there is a relation between TBC_Vertical and opportunity. why the below query ( the same you suggested didn't work). In the below query if I just remove TBC_vertical subquery (select) and run, it works. Not sure what could be the reason/trick here
SELECT Name,
(SELECT UnitPrice FROM OpportunitylineItems) ,
(SELECT Revenue__c FROM Opportunity_Line_Item_facts__r) ,
(SELECT Name FROM TBC_Verticals__c)
FROM opportunity
They are connected just by the ID's that is a text field (i hope).