You need to sign in to do that
Don't have an account?
EricJRosenberg
I need help with writing SOQL.
I know how to write SQL but and having trouble with creating a join with SOQL. I am trying to connect the Opportunitiy table with the Campaign table. I keep getting and error about creating a custom relationship. It says 'If youa re attempting to use a custom relationshipbe sure to append the '_r' after the custom relationship name. The Query I am using is
Select o.CampaignId, o.Name (Select c.Id from Campaigns) from Opportunity o
Try this
Select o.CampaignId, o.Name (Select c.Id from Campaigns__r) from Opportunity o
add the __r to Campaigns
Let me know if this works
Nope still get the same error.
Try this
Select o.CampaignId, o.Name (Select c.Id from Campaigns__r c) from Opportunity o
You missed the c after Campaigns__r
you missed the , after o.Name