I’ve been doing a lot of data imports to CRM 2011.  When it comes to showing the client where the fields are getting mapped, it’s a bit of a hassle.

If you export the data map you get a nice XML document, but you can’t exactly show that to your business lead (it’s difficult to read even if you know XML).

So, I created a nice chunk of XSL to make a better way to present the data mapping.

<?xml version=”1.0″?>
<xsl:stylesheet version=”1.0″
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”&gt;

<xsl:template match=”EntityMaps/EntityMap”>
<html>
<body>
<h2><xsl:value-of select=”@SourceEntityName”/> | Target: <xsl:value-of select=”@TargetEntityName”/></h2>
<table border=”1″>
<tr bgcolor=”#9acd32″>
<th>Source</th>
<th>Target</th>
<th>Process Code</th>
</tr>
<xsl:for-each select=”AttributeMaps/AttributeMap”>
<xsl:sort select=”ProcessCode” order=”descending”/>
<xsl:sort select=”SourceAttributeName”/>
<tr>
<td>
<xsl:value-of select=”SourceAttributeName”/>
</td>
<td>
<xsl:if test=”TargetAttributeName != ””>
<xsl:value-of select=”TargetAttributeName”/>
</xsl:if>
<xsl:if test=”TargetAttributeName = ””>
<xsl:text disable-output-escaping=”yes”><![CDATA[&nbsp;]]></xsl:text>
</xsl:if>
</td>
<td>
<xsl:value-of select=”ProcessCode”/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Save that to a file in the same folder as your XML file, then add the line below to the XML file itself (where ImportMapping.xslt is the name of the xsl file).

<?xml-stylesheet type=”text/xsl” href=”ImportMapping.xslt”?>

About these ads