You need to sign in to do that
Don't have an account?
Alaric Wimer
How to query all a list of Opportunities that are counted in the Campaign record's "Opportunities in Campaign" field?
I have a Campaign called "My Campaign" where I can see the "Opportunities in Campaign" field. It has a value of 41. However, when I try to query a list of these Opportunities with the following query (see below) I get 0 records found. Does anyone how I can query these Opportunities?
What I'm ultimately trying to do is create a field on the Campaign (using a trigger) that shows how many Opportunities are in a particular stage. So, I'd like to know how to query and filter these Opportunities that make up this count.
SOQL query that returned 0 records:
SELECT Id, Campaign.Name FROM Opportunity WHERE Campaign.Name = 'My Campaign'
Can you try using %% and Like like below:
Hope this provides some query results. Also, if possible can you share one Opportunity record details i.e. name, campaign name to look more into the issue if un-resolved.
Thanks,
Gaurav
Skype: gaurav62990
Thank you Gaurav, unfortunately I've already tried the LIKE filter with no results.
However, I've noticed that the Opportunities appear in the Campaign's "Influenced Opportunities" related list. So another way to think of what I need is how can I query the "Influenced Opportunities" related list on the Campaign?
can try this link (https://intellipaat.com/community/14979/salesforce-soql-campaigns-with-influenced-opportunities)
Do you know how I can get the COUNT(Id) of each Campaign into a variable so I can set it to the Opportunity by stage field on the Campaign object that I want to create? The query I used from that link was: