Tuesday, April 7, 2015

Comparison of Salesforce Campaign IDs

I am sure a lot goes on in each of our professional lives when the day begins and we are kind of juggling with multiple priorities and tasks to finish. Limited time can cause roadblocks for tedious tasks specially when there is a lot of manual comparison to be done between two sandboxes. Thanks to the universe of online tools where we can find most of the answers to our problems by selecting the right tool, although it is a challenge to know which tool should be used in which problem? I happen to come across a similar issue while working on the lead assignment rule. I thought of sharing this on my blog, although the trick is very simple but at times such simple tricks can save us a hell lot of time. 


In salesforce there are exceptional cases when the change set, ANT, or any other custom tools ( Mavens Mate)  does not allow users to pick components on granular level for deployment like Lead assignment rule criteria.  You can either deploy the entire lead assignment rule or make the changes manually.

I came across a challenge where I updated one rule criteria with 40 campaign names and Id’s.Our organization has more than 50 lead assignment rule criteria’s and since the sandboxes are not refreshed very often there is a huge possibility of having differences in the campaign ID’s in the sandboxes. You must be wondering why this is so? When the sandboxes are refreshed from the production the campaign ID’s are identical but if the sandboxes have not been refreshed lately then the new campaigns have to be handled by manually creating them in the sandboxes which definitely makes the campaign ID’s different in each sandboxes. It is recommended to confirm if the target sandbox does not have any discrepancy in the data specially when there are multiple teams and users working and testing on the same development environment, it can get pretty muddy. 

Coming back to the lead assignment rule I have two options
1)      Deploy the entire Lead assignment rule from sandbox1 to sandbox2
2)      Move the changes manually from sandbox1 to sandbox2

Deploying the entire lead assignment rule could be very tempting but we need to make sure if the rule criteria’s and their ID’s match in the source and target sandbox. I used a trick of copying the source sandbox lead assignment rule in a notepad file and named the file as “sandbox1” and target sandbox lead assignment rule as “sandbox2”.

The trick is to compare the campaign Id’s using data comparator and make sure there are no discrepancies. Google any data comparison tool you will find plenty of them and most of them have the same functionality. Follow the steps below to learn, how I compared lead assignment rule of two sandboxes using Winmerge.

Step1: Download any data comparison tool for text files, I downloaded winmerge


Double click on the WinMerge icon from your desktop or the Start bar 

Step2: Go to files à Open 



Step3: Winmerge provides an option of comparing two conflict files side by side. You can browse sandbox1 file on the left pane and sandbox2 on the right pane


Step4: Browse the files in the left and right fields and select ok. Conflicted data will be highlighted with orange. I was surprised to find a lot of data discrepancy in the campaign Id’s between the source and target sandbox. I dropped the idea of deploying the lead assignment rule and manually created the rule criteria for the lead assignment rule in my target sandbox.


Conclusion: From this article we learned a new tool “Winmerge” and a simple trick of comparing campaign id's between two sandboxes.  








No comments:

Post a Comment