function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Surinder Singh 25Surinder Singh 25 

Opportunity with Campaign records update

 Create a batch which looks at all active Opportunities and IF there is only one campaign and the Primary Campaign Acitivity is not checked, check it. There should be no active Opps with Campaigns that do not have a Primary campaign checked.

Basically i have to look all existing opp if there is any opp having only single Campaign records and Primary campaign activity is not checked then i have to check.

I have no idea of Opp and campaign relationship. Please let me know how i can do this.
GauravGargGauravGarg

Hi Surinder, 

Campaign and Opportunity are directly linked, but there is filter criteria or method to identify which Campaign is related to which Opportunity, so  you need to first identify the following question before going through the batch job
1. How to identify if a Campaign is related to particular Opportunity.
2. What need to be done if multiple Campaign are active for a particular Opportunity. 

If you have above questions, then writing batch is a mere task which can be completed in few hours. 

Let me know if you more insight on this. 

Thanks,
Gaurav

Surinder Singh 25Surinder Singh 25
Hi Gaurav,

Thanks for response!
I actually wanted to do is - Extract all active opportunities having only single campaign. And if Primary Campaign source checkbox is not checked for that opportunity i had to check and update. I wanted to do this by dataloader as i have to update the existing records.

Can you tell me how can extract active opportunites from data loader with this condition - Active opportunities having only one campaign related.

Thanks,
Surinder
GauravGargGauravGarg
Hi Surinder, 

Actually Opportunity and campaign have many to many relationship i.e. one Campaign can have multiple Opportunity and One Opportunity can be linked with multiple Camapign. 

So, to implement the above requirement, we need to extract two reports
--> Campaign -- Which are atleast linked with one Opportunity. 
--> Opporutnity.

Now you need to manually do the V-lookup thing and identify if single Opportunity has more than one Opportunity. 

Let me know if you need more help on this. 

Thanks,
Gaurav
Skpe: gaurav62990