Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


CRM 4 - Format Date/Time fields in emails with a plug-in

Post Author: Joe D365 |

As you start to use crm 4 you will sooner or later desire new features or enhancements to what is available out of the box for formatting an email. For example, one of the requested features we have had is nicely formatting dates. Out of the box when you email merge a date/time field the date will format as: mm/dd/yyyy hh:mm am - which looks kind of ugly.

With a relatively straight forward plug-in on the 'send' message on the email entity, you have access to change anything on the email message after it has been created by crm.

For example one option would be to create your own 'formatting' tags. In our case we needed a nicely formatted date in the format such as January 01, 2010 with no date/time. By writing a plug-in using the message above we created a simple plug-in that looks for tags any type of date or date type and replaces with a nicely formatted date.

So we can have our own formatting tags right in our template:

The only caveat is to not use codes that overlap with html. This concept can be expanded to fetch addition data or add additional formatting.

 

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

2 comments on “CRM 4 - Format Date/Time fields in emails with a plug-in”

  1. Good post. An alternative method, which I've employed, is a custom workflow action. Two inputs, one the datetime value and the other the .net formatting code. The output is the ToString(formatting code) of the datetime input. You can then have any format in the email you like. Very flexible.

    1. Yep - that's a good method two. We have used that in the past. We developed the plugin since the customer had to many fields to be formatted.

PowerObjects Recommends