Neil McDonald's Dynamics CRM Blog

Archive for July 2010

Update Rollup 12 for Dynamics CRM 4

leave a comment »

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

Written by neilmcd

July 30, 2010 at 2:03 pm

Posted in CRM 4

Free CRM 4 HTML Email Campaigns

leave a comment »

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.

Mark1

Read the rest of this entry »

Written by neilmcd

July 26, 2010 at 3:41 pm

Posted in CRM 4

Tagged with ,

Dynamics CRM spell checking

with one comment

Spelling

Sending important emails containing spelling errors is unprofessional. Unfortunately, Dynamics CRM does not come with spell check functionality.

The Google toolbar includes a built in spell checker which, when combined with tabbed browsing, makes spell checking CRM emails easy.You’ll need to follow my guide to enable tabbed browsing and also install the Google toolbar. Once it’s installed, just click on the spell check button when writing an email and any spelling mistakes will be highlighted and suggestions given.

There are a variety of accelerators that can add this functionality but I have yet to find one for free.

Thanks to Craig for the suggestion!

Written by neilmcd

July 20, 2010 at 10:58 am

Checking SQL table sizes

leave a comment »

Sqlsize

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

Written by neilmcd

July 19, 2010 at 6:07 pm

Posted in Misc

Tagged with

Get past the 250 records per page limit

with one comment

Screen_shot_2010-07-18_at_17

Dynamics CRM 4 only allows users to view a maximum of 250 records per page within a view. This can be quite limiting when you need to run an on demand workflow against thousands of records.

There are 2 ways to get around this limit. The Microsoft supported solution is to use a plugin as described here. The unsupported and more risky workaround (and what I did…) is to update the organisation database directly as below.

UPDATE UserSettingsBase SET PagingLimit=1000 WHERE SystemUserId IN(Select SystemUserId from SystemUserBase WHERE FullName = 'neil mcdonald')
Screen_shot_2010-07-18_at_17.57.36.png.scaled1000

If using the SQL method, I recommend that you change it back to 250 rows or less once you’ve accomplished your tasks, as this is not supported by Microsoft and could cause errors with future updates.

Written by neilmcd

July 18, 2010 at 4:43 pm

Posted in CRM 4

Tagged with , ,

Set age based on date of birth

with one comment

Dob_js

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();
}
}
}

Written by neilmcd

July 16, 2010 at 11:07 am

Posted in CRM 2011, CRM 4

Tagged with ,

CRM 5 at WPC 2010

leave a comment »

Microsoft_crm_familiar_view

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.

Written by neilmcd

July 15, 2010 at 7:57 pm

Posted in CRM 2011

Tagged with ,