Monday, September 26, 2016

Email template : Show Date or Time portion only for DateTime attribute

Sometime when sending emails using email templates we do not want to show time portion, e.g. BirthDate.

Contact record

Email Template


Email using template



 To remove time portion from BirthDate in email template, you need to modify template XML.
  1. Create Solution, with email template
  2. Export Solution to local machine
  3. Open Customization.xml file.
  4. Look for email template
  5. In Email template XML, check  presentationxml tag.

        It will look like

  <template><text><![CDATA[Dear&#160;]]></text><slugs><slug><entity>contact</entity><attribute>fullname</attribute></slug><default></default></slugs><text><![CDATA[ <font face="Tahoma, Verdana, Arial" size=2 style="display:inline;"></font><div>Your date of birth in system is&#160;]]></text><slugs><slug><entity>contact</entity>&lt;attribute>birthdate</attribute></slug><default></default></slugs><text><![CDATA[ </div><div><br></div>]]></text></template>


6. This is decoded HTML, you can use online HTML decoders to decode, or look for attribute, e.g. BirthDate

 < template >< text > <![CDATA[Dear ]] >< /text >< slugs >< slug >< entity >contact< /entity >fullname< /attribute >< /slug >< default >< /default>< /slugs >< text >< ![CDATA[?< font face="Tahoma, Verdana, Arial" size=2 style="display:inline;" >< /font >< div >Your date of birth in system is ]] >< /text >< slugs >< slug >< entity >contact< /entity >< attribute >birthdate < /attribute >< /slug >< default >< /default >< /slugs >< text >< ![CDATA[?< /div >< div >< br >< /div >]]>< /text >< /template >


7.Change  < attribute >birthdate < /attribute >  to  < attribute >birthdate/@date < /attribute >

8. Encode template HTML, and put it back into Customization.xml file in presentationxml tag. 

9.  Save customization file, Zip and re-import to CRM.

10. Don't Forgot to publish solution.

Note: It might be when you re-import solution some special character added in template.

Remove special character, save template





Now try now email with same template, and you will see only date portion of BirthDay.


In case want to show only time from datetime field, in email template then change 

7.Change  < attribute >birthdate < /attribute >  to  < attribute >birthdate/@time < /attribute >





Friday, September 23, 2016

Email Signature

In CRM 2016 / Online, you can create email signature, which will be used when sending emails from CRM.

  • Email Signature will be created for Individual user or team
  • User can create more than one email signatures
  • Default signature will be automatically added to email when email created in CRM system.
  • User can select different signature for email, if user has more than one signature.
  • Each user or team has only one default signature.
  • When you change the owner of an email signature, the signature reverts to non-default. For example, a signature is a default for user A. User A assigns it to queue X and queue X already has a default signature. The signature assigned will be non-default for queue X. If queue X does not have a default signature, the new signature will become the default signature.
  • When Form field in email changed, email signature for User / Queue owner will be automatically added to email, if user / queue owner has default signature. 

To create Email signature 
  • Go to user settings and select options 

  • Then select Email Signatures tab

  • Create new Signature

You can set default signature, by clicking on “Set as Default” ribbon button.
If want to remove default signature, for default signature ribbon button will be “Remove Default”.


  • Once Signature is created, now create email
  • By default Form field will be user, and if user has default signature, then signature will be automatically populated in email. 

  •    If there are multiple signature for users and don’t want to use default signature for email, then use “Insert Signature” button shown in Email rich text box ribbon.




Thursday, September 22, 2016

Alternative unique key for an entity

In CRM each entity has unique identifiers defined as GUIDs. This is primary key for each entity. 

Sometimes, when integrating CRM system with other system or converting legacy system into CRM, we need to store existing database unique key into CRM. 

From CRM 2015 Online (update 1) Microsoft introduced alternate keys for entities. 

Alternate keys you can now define an attribute in a CRM entity to correspond to a unique identifier (or unique combination of columns)

Key points for Alternative key
  • Alternate key defined on Decimal number, Whole Number or Single line of Text attributes only.
  • You can combine two or more different types of attributes into Alternate Key.
  • You can create key on maximum 16 columns / attributes combination.
  • Total Key size should not violate SQL based index constraints like 900 bytes per key.
  • For each entity you can define maximum 5 alternate keys.