Archive for Jul 2010
Update Rollup 12 for Dynamics CRM 4
Microsoft have released Update Rollup 12 for Dynamics CRM 4. As usual it contains the normal batch of bug fixes, but importantly, it also adds rule deployment wizard support for Exchange 2010. Read more about the update here
Free CRM 4 HTML Email Campaigns
Dynamics CRM 4 does not come with the ability to compose HTML emails. This limits what can be done via marketing campaigns and email templates. There are companies who have created various addons and accelerators for this. Most give marketing stats and pretty graphs, but they are very expensive and do more than you need in many cases.
If you are looking to just send out a HTML email and do not care about click through rates etc then this free option should help. You’ll need a HTML editor and a web site where you can host a web page and some images.
First of all, you need to create your HTML email in you HTML editor.
Checking SQL table sizes
I wanted a way to find which tables were using the most storage in my SQL databases. The stored procedure sp_spaceused will show this data for a single table, but I wanted to view every table at once. The below SQL query will run against any SQL 2005 database and show you it’s table sizes in descending order. As expected, the ActivityMimeAttachment table in my CRM database was pretty huge!
SELECT sys.schemas.[name] AS [Schema], sys.tables.name AS [Table], COALESCE([Row Count].[Count], 0) AS [Rows],COALESCE(8192 * [Data Pages].[Count],0) AS [Data Bytes], COALESCE(8192 * [Index Pages].[Count],0) AS [Index Bytes] FROM sys.tables INNER JOIN sys.schemas ON sys.schemas.schema_id = sys.tables.schema_id LEFT OUTER JOIN (SELECT object_id,SUM(rows) AS [Count] FROM sys.partitions WHERE index_id < 2 GROUP BY object_id) AS [Row Count] ON [Row Count].object_id = sys.tables.object_id LEFT OUTER JOIN (SELECT sys.indexes.object_id,SUM(CASE WHEN a.type <> 1 THEN a.used_pages WHEN p.index_id < 2 THEN a.data_pages ELSE 0 END) AS [Count] FROM sys.indexes INNER JOIN sys.partitions AS p ON p.object_id = sys.indexes.object_id AND p.index_id = sys.indexes.index_id INNER JOIN sys.allocation_units AS a ON a.container_id = p.partition_id GROUP BY sys.indexes.object_id) AS [Data Pages] ON [Data Pages].object_id = sys.tables.object_id LEFT OUTER JOIN (SELECT sys.indexes.object_id,SUM(a.used_pages - CASE WHEN a.type <> 1 THEN a.used_pages WHEN p.index_id < 2 THEN a.data_pages ELSE 0 END) AS [Count] FROM sys.indexes INNER JOIN sys.partitions AS p ON p.object_id = sys.indexes.object_id AND p.index_id = sys.indexes.index_id INNER JOIN sys.allocation_units AS a ON a.container_id = p.partition_id GROUP BY sys.indexes.object_id) AS [Index Pages] ON [Index Pages].object_id = sys.tables.object_id ORDER BY [Data Bytes] desc
Set age based on date of birth
I had a requirement to set an ‘Age’ attribute based on the contents of the Date of Birth field on Contacts. The below script in the On Save, On Load or On Change will do this.
Note: You will need to change the “birthdate” and “new_age” field names to the relavant fields on your form.
CRM 2011
function calcBirthday() { if(Xrm.Page.getAttribute("birthdate").getValue() != null) { var now = new Date(); //get today's date var birthday = Xrm.Page.getAttribute("birthdate").getValue(); //get the dob value var diff = now.getMonth() - birthday.getMonth(); //have they had their birthday already this year? var age; //use to store age if (diff == 0) //if birthday is this month, compare the days instead { diff = now.getDate() - birthday.getDate(); } if(diff > -1) //if they've had a birthday this year { age = now.getFullYear() - birthday.getFullYear(); } else //if they have not had a birthday yet this year { age = now.getFullYear() - birthday.getFullYear() - 1; } Xrm.Page.getAttribute("new_age").setValue(age.toString()); //set the new_age attribute } }
CRM 4
function calcBirthday(){ if(crmForm.all.birthdate.DataValue != null) { var now = new Date(); //get today's date var birthday = crmForm.all.birthdate.DataValue; //get the dob value var diff = now.getMonth() - birthday.getMonth(); //have they had their birthday already this year? if (diff == 0) //if birthday is this month, compare the days instead { diff = now.getDate() - birthday.getDate(); } if(diff > -1) //if they've had a birthday this year { var bd1 = now.getFullYear() - birthday.getFullYear(); crmForm.all.new_age.DataValue =bd1.toString(); //set the new_age attribute } else //if they have not had a birthday yet this year { var bd2 = now.getFullYear() - birthday.getFullYear() - 1; crmForm.all.new_age.DataValue =bd2.toString(); } } }
CRM 5 at WPC 2010
Microsoft have released the hour long Worldwide Partner Conference 2010 session on Dynamics CRM 5 (now officially called Dynamics CRM 2011). You can watch the video here.??
They also announced the Dynamics Marketplace,??which is a place for partners to share applications and extensions with the rest of the Dynamics community.
Both the Dynamics Marketplace and CRM 2011 beta should be available in September 2010.
IE8 crashing when using picklists in Advanced Finds
I’ve been having an issue where IE8 would crash when trying to use picklists in advanced finds (see below example).
It may not be a common issue, but I posted it on the MS partner forums and got the below response which has fixed it for me, so hopefully it will help someone else out too!
Edit AdvFind.aspx and add the following code. AdvFind.aspx can be found in the CRM web directoryAdvancedFind
NOTE: The code needs to be added right below function window.onload(){
<% if (Request.Params["AutoRun"] != "False") { %> if (location.href.indexOf("?") > 0) location.href = location.href + "&AutoRun=False"; else location.href = location.href + "?AutoRun=False"; <% } %>
CRM pop-ups in new tabs
With Internet Explorer, you have the option to open all pop ups in a new tab rather than a new window. I find this works great for CRM, particularly when working inside different organisations. I can keep my development organisation and all pop ups in one IE instance and my live instance in another. You can find the option to do this under IEToolsInternet Options and click the Settings button under the Tabs section on the General tab.
CRM iPhone homescreen icon
I sometimes like to check up on cases and activities from my iPhone and have a homescreen shortcut to our CRM mobile express site. By default, Dynamics CRM does not have an iPhone icon, so I created one for myself here. If you’d like to use it, download it, save it as apple-touch-icon.png and drop it into your CRM web root folder (mine is c:inetpubwwwroot). When you next navigate to your CRM mobile express site, add it to your homecreen and it will display a much prettier icon.