Monday, December 14, 2009

Automatic salutation for contacts in CRM 4.0

I was asked to bring more uniformity in the use of the Salutation attribute in CRM. In this case, the field is used to contain the Dutch equivelant of "Mr" and "Mrs". But there should be an option to give a contact a different or additional salutation.

Here's how it's resolved:



Initially, the Contacts form holds the Salutation text field. We want to reuse this field, but make it more stable.

On the 2nd tab (Details), there is a dropdown listbox for Gender:



This attribute is optional and contains two values, Male and Female.

First we move the Gender field to tab General, section Name:



Next, open the field properties and go to the event tab:


Edit the onChange event and add the following code:


Enable the event and add the fields "Gender" and "Salutation" to the dependent fields.

After you publish the changes, the Salutation field will update to contain one of the the chosen values defined in maleSaltutation and femaleSalutation, whenever the gender attribute changes, unless a different salutation is provided:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.