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.
Create Solution, with email template
Export Solution to local machine
Open Customization.xml file.
Look for email template
In Email template XML, checkpresentationxmltag.
It will look like
<template><text><![CDATA[Dear ]]></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 ]]></text><slugs><slug><entity>contact</entity><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 >
I came across business requirement like, if there are any
active child records, then show error message to users when deactivating parent
record.
I can use plugin or real time workflow for this, but when
error message thrown, CRM throws error like Business process error.
But customer doesn’t want to see this business process
error, customer wants Alert message, and do not want to deactivate record.
To full fill this requirement I customized CRM button
command, and added my own script on deactivate button.
Here are steps I did
I am using Ribbon workbench to customize entity ribbon.
1.Customize Deactivate command
2.Once command is customized you will see
JavaScript library and function used by MS CRM.
3. Change function Name to NaN and remove
parameters for CRM default deactivates action.
This we need to do so when condition is
satisfied, record should be deactivated and CRM JavaScript library should be
loaded.
4.Now add your own JavaScript action in deactivate
command, and call your own JavaScript function
When calling own JavaScript function make
sure you are using same Parameters used in CRM default deactivates function, as
we are going to call this function in our own JavaScript.
5.In your JavaScript code, you can check, is there
any active child records associated with this record? If not then deactivate record,
otherwise show message.
JavaScript code is
CheckOnDeactivation:
function
(CompanyId, entityName) {
Rollup fields in CRM are updated asynchronously ever 1 hr.
you can manually refresh individual rollup field on form by clicking
refresh button, but some time we need to refresh all rollup fields on form in
single click.
To do this
1. Create custom
workflow activity which will calculate all roll up fields and update values.
To calculate
rollup fields you can useCalculateRollupFieldRequest message,
and pass it to Execute.