Last year Phil Richardson and Ben Vollmer both posted solutions that would enable us to better track birthdays within CRM. In May of 2007, the solution was added to the CRM How To series.
To review the situation we find that while Microsoft provided us with a Birthday Attribute on the Contact Entity it's really hard to perform a search for birthdays because we need to know at what point the future will a contact's birthday occur again.
Their solution is to create two custom fields that hold the birthday month and the birthday day. The addition of these new Attributes allows us to perform Advanced Find operations such as: "Show me all birthdays in December", so we can get birthday cards into the mail.
The How To article provides instructions on how to add the Attributes in question and provides the JavaScript code to populate those attributes whenever someone changes a Contact's birthdate.
I would like to suggest a small change to that solution: Instead of tracking the birthday month by number, I wanted to use the month's name. You basically follow the instructions in the How To article but when you start to create the Birthday Month Attribute, make it a nvarchar(10) instead of an integer.
Use the following JavaScript code in the Birthdate Attribute's OnChange event to populate the name of the month in the Birthday Month Attribute:
1: if (crmForm.all.birthdate.DataValue != null)
2: {
3: var monthList = new Array(
4: "January","February", "March",
5: "April", "May", "June",
6: "July", "August", "September",
7: "October", "November", "December");
8:
9: var bd = crmForm.all.birthdate.DataValue;
10: crmForm.all.new_birthdaymonth.DataValue = monthList[bd.getMonth()];
11: crmForm.all.new_birthdaymonth.ForceSubmit = true;
12: crmForm.all.new_birthdayday.DataValue = bd.getDate();
13: crmForm.all.new_birthdayday.ForceSubmit = true;
14: }
15: else
16: {
17: crmForm.all.new_birthdaymonth.DataValue = null;
18: crmForm.all.new_birthdaymonth.ForceSubmit = true;
19: crmForm.all.new_birthdayday.DataValue = null;
20: crmForm.all.new_birthdayday.ForceSubmit = true;
21: }
So that takes care of all new birthdays added to the system. But what about the birthdays that already exist?
Well, that took a bit more work since we need to perform an update to the database for each Contact record containing a birthday.
Attached to this article you will find a small utility that will update the new birthday month and birthday day Attributes you added based on the Contact's birthdate. This utility can be run at any time to update any CRM Contact that contains a Birthdate.
Download: CRMUpdateBirthdayList
Review the enclosed CRMUpdateBirthdayList-Readme.doc file for configuration and usage instructions.
This utility can be run from either the CRM Server or from a workstation on which the CRM Outlook client has been installed.
4 Responses
Mitch Milam’s Microsoft Discussions » Blog Archive » Using Metadata to make intelligent programming decisions
11|Nov|2007 1[...] This morning I released a small utility to update additional birthday information for CRM Contacts. [...]
Techy News » Blog Archive » Birthdays in CRM: Revisited
11|Nov|2007 2[...] Read the rest of this great post here [...]
dejandular
12|Nov|2007 3I like the idea, but wouldn't it be better if you did this with callouts? Your solution won't work if a the data is imported into CRM.
mitch
12|Nov|2007 4In this particular case, I really didn't want to overhead of a callout involved in each operation involving the Contact. The customer I created this for migrated from Act!, which was a one-time operation. Once this utility has been run, and you can run it at any time, the JavaScript code will handle any additional updates to existing or new records.
Mitch
Leave a reply
Search
Categories
Archives
Meta
Most Viewed
Tags