Monday, 20 June 2011

Silverlight Map in CRM 2011


There are many cases in which an organization will need to work with maps as part of their Dynamics CRM experience. For example, you might be part of a courier company that needs to be able to see your customer locations in a map before you can deliver the goods. It is now very easy to create a map which you can then embed inside Dynamics CRM 2011 through Silverlight web resources.
 How to Create a Silverlight Map Control for Dynamics CRM 2011
Firstly, I’ve created a new Silverlight project inside Visual Studio and have also downloaded the Bing Maps Silverlight Control SDK. The SDK includes the required libraries which you can reference to build your own controls using a Silverlight Bing Map.
Before you can actually start building and testing your mapping application, you will need to obtain an API key for the Bing Maps Silverlight Control. You will need to insert this key into your XAML code for the map to work correctly.
<UserControl x:Class="DisplayMap.MainPage"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"    mc:Ignorable="d"    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">        <m:Map x:Name="mymap" CredentialsProvider="<your key goes here"></m:Map>    </Grid></UserControl>
The next step is to add the map into CRM. To do this, locate the XAP file as part of the Visual Studio project. This is the file that we want to upload as our Silverlight Web Resource.
 How to Create a Silverlight Map Control for Dynamics CRM 2011
Open up CRM and navigate to Settings > Customizations> Customize the System. On the left navigation, click on Web Resources and then click on New to create a new Web Resource.
 How to Create a Silverlight Map Control for Dynamics CRM 2011
Give the new web resource a name and also select Silverlight as the type. Once this is done, save and publish your changes.
I am going to select the Account entity to hold our map control. Expand the Entities node in the customization area, select Account and then open up the main Account form.
I have created a new section on the Account form and have added the Silverlight web resource to it.
 How to Create a Silverlight Map Control for Dynamics CRM 2011
Now that it’s been added to the Account form, we just need to save and publish our changes once again. Now the map will be available for our users to view.

Creating an HTML Email in Dynamics CRM 2011

Microsoft Dynamics CRM 2011 makes bulk emailing very easy by using Mail Merge with Microsoft Word. This means you can send out newsletters to hundreds of your Dynamics CRM customers all at once, from one location. Because the Mail Merge is done within Microsoft Word, you can create full HTML emails with images and colours to reflect your company, and grab your customers’ attention.
Creating an HTML Email in Dynamics CRM 2011 
For this example we will be creating a reusable Mail Merge Template for an HTML Newsletter, so we can send frequent newsletters to our customers using the same template and theme. This template will be configured to send to Contacts, and we will set the template to pull through the Contacts first name, to personalize the email.
To create a new Mail Merge Template in Dynamics CRM 2011, navigate to SettingsTemplatesMail Merge Templates, and then click New.  Enter a Name, for example ‘Newsletter’, and set the Associated Entity, in this case we will use ‘Contact’. Click ‘Save’ and the record will be created.
Creating an HTML Email in Dynamics CRM 2011 
Next you need to create the word template file. If you have one already you can upload it at the bottom of the form, otherwise click ‘Create Template in Word’ at the top of the form to start from scratch.
Creating a new HTML Word Template
The template can be created in either an HTML editor, or simply within word itself. If you decide to use word to create the HTML template, you can use the default options such as tables, images, colours, and fonts to customize the template to look how you want. It is recommended that you use tables to colour and align your objects within your HTML email templates, as they show up best in email readers.
Creating an HTML Email in Dynamics CRM 2011 
For more complex designs, it is recommended that you use an HTML editor to create your template, such as Expression Web or Dreamweaver. This way you can customize and position objects exactly where you need them, and you can apply custom styles to your HTML.
NOTE: Make sure all CSS is embedded inline, and not called internally or externally. Also make sure to use full URL references for images and hyperlinks.
If you have created your template in an HTML editor, you can copy the whole page content when viewing the template in your internet browser, and paste it into word. You may need to change some things around to make it look right again. (It can help to change the view to web layout - click the View tab and select Web Layout in Word 2010)
Once you are happy with your template, save it as an .xml file, as something meaningful, for example ‘newsletter.xml’. You can save the template in .xml format by click FileSave As, and selecting ‘Word XML Document (*.xml)’ from the Save as type menu in Word 2010.
Creating an HTML Email in Dynamics CRM 2011 
You can now go back to your Mail Merge Template in Dynamics CRM 2011 and upload the .xml file using the ‘Browse’ button at the bottom of the form. Once selected click ‘Attach’.
Note: To make the template Organization Owned (usable by everyone) select ‘Make Available to Organization’ from the Actions menu.
To start using the template, navigate to Contacts, and select the contacts you wish to send the newsletter to (it might pay to run a test on yourself before emailing your customers). From the ‘Add’ tab, select Mail Mergeunder ‘Marketing’. In the Mail Merge window, select to start with an Organization or Personal template depending on which option you set earlier. From the lookup select the ‘Newsletter’ template. Choose whether to run the mail merge on all records, or just the ones selected, and then click OK.
 Creating an HTML Email in Dynamics CRM 2011
When the word document opens, you will need to click the CRM icon to enable the CRM add-in, which can be located under either the Mailings tab or the Add-Ins tab in Word 2010. After clicking this you will be able to see your template.
If the step by step mail merge wizard doesn’t appear automatically on the right side of the document, you can click Start Mail Merge, and select Step by Step Mail Merge Wizard from under the Mailings tab. From this wizard you can click through the steps until step 4 where you can choose to insert More Items, which will allow you to insert fields from the Dynamics CRM 2011 Contact form, such as ‘First Name’ for personalizing the emails.
Creating an HTML Email in Dynamics CRM 2011 
Note: If you want to insert Merge Fields you can resave the .xml file and upload it again to your Mail Merge Template record to save them for next time.
At this point you can update the template to contain the content and images you want added to the email. Once you have done this, and you are ready to send the email, you can click Finish & Merge from the Mailings tab, and then select Send E-mail Messages. You will be prompted to select the ‘To’ field, which is ‘E_mail’, and the subject that will be displayed in the Email messages. Leave the Mail format in HTML, and click ‘OK’ to send the emails to all records.
Creating an HTML Email in Dynamics CRM 2011 
Each email you send from the Mail Merge will be added to your Outlooks queue, and will one by one be sent from Outlook with the email account you have configured. That’s all there is to it, the emails will now be sent to your customers, and each email will be personalized with the appropriate name.
Creating an HTML Email in Dynamics CRM 2011
http://www.magnetism.co.nz/blog/paul/11-05-10/Creating_an_HTML_Email_in_Dynamics_CRM_2011.aspx
Source : 

Restrict Sales and Marketing Controls in CRM 2011


Historically in CRM 4.0 if a user wanted to have the Sales and Marketing Controls not displayed for an given user, this could not be as were by design.
Although areas would not be shown when all subareas are not visible by the security role.

It is not possible to remove the entire buttons. However, for Sales, Marketing, Service, etc... the application does contain the logic to not show a button "Area" if there are no sub-areas under it to show.
It is possible to limit visibility to a sub-area based on the security access. This is documented in the SDK and if you search for the "SiteMap XML Reference" and click on privilege, you will see the documentation on this.

More on this on how simple it is to modify the sitemap and hide areas is below:

If you put both these factors together you could limit the sub-area access for every sub-area based on privileges, then the main area buttons would go away since nothing would be visible for the user.
Do a database backup and also backup the site map first. Review the CRM 2011 "SiteMap XML Reference" before performing these actions.
1. Go to Settings > Customizations > Export Customizations/ Solutions
2. Choose Site Map from the list and click Export Selected Customizations.
3. Make sure to save a copy of the Site Map before making any changes.
4. Open up the site map and search for text that begins <Area ID="MA" ResourceId=Area_Marketing" and ends with </Area> remove the entities (sub-areas) the visible entities like account and contact from this area.
5. Save this as your edited site map.
6. Go to Settings > Customizations > Import Customizations.
7. Browse to your edited site map and import it into CRM.
8. Publish your customizations.