Tuesday, September 17, 2013

Export/Import user saved views in Microsoft Dynamics CRM 2011

Export and Import user saved views in Microsoft Dynamics CRM 2011.

As we know user can't "move" his saved views from one environment to another. There is a third party product available to do the same.
The application has been created using Silverlight and its available for download for free.

The application can be downloaded from here:
http://exportimportuserview.codeplex.com/releases

Please go through the below link for the instructions:
http://dynamicslollipops.blogspot.in/2011/07/export-import-user-saved-views.html

Friday, September 13, 2013

Get Campaign List for a given Account/Contact in MS CRM 2011

Get all campaign where the given Account is part of.

SELECT CodeName,name FROM FilteredCampaign  -- Campaign Deatils
WHERE CampaignId IN (
SELECT CampaignId FROM FilteredCampaignItem -- Marketing list associated with the Campaign
WHERE EntityId IN (
SELECT LM.listid FROM FilteredListMember LM -- account associated with all marketing lists
LEFT JOIN FilteredAccount Account ON Account.AccountId=EntityId
WHERE Account.name='HP'))

Get all launched campaign where the given Contact is part of.

SELECT CodeName,Name FROM FilteredCampaign -- Campaign Deatils
WHERE CampaignId IN (
SELECT CampaignId FROM FilteredCampaignItem  -- Marketing list associated with the Campaign
WHERE EntityId IN (
SELECT LM.listid FROM FilteredListMember LM -- contact associated with all marketing lists
LEFT JOIN FilteredContact CONTACT ON CONTACT.ContactId=EntityId
WHERE CONTACT.FirstName='CHANDAN'))
AND statuscodename='Launched' -- Only LAUNCHED CAMPAIGN