Show date only of Modifiend on in email template Crm 2011 online - dynamics-crm-2011

I would like to ask one question relation to crm 2011 online email template.
In email template, I show Modified On Date. But It shows date and time. I want to show only date. How can achieve this? Please let me know any idea. Thanks....

There is no supported method to do this, however if you really need it, it might be worth trying this (note: I haven't tried this!).
Add your template to a solution (or a test one, for now), export it as unmanaged and edit the customizations.xml file. In the XML you will see a representation of your template with the dates in there. Look for the body node of your template and you'll see something like this in there (xml, encoded within xml):
<body><?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="no"/>
<xsl:template match="/data">
<![CDATA[<font size=2 face="Tahoma, Verdana, Arial">
<p>Value of Created On: ]]>
<xsl:choose><xsl:when test="systemuser/createdon">
<xsl:value-of select="systemuser/createdon" />
</xsl:when><xsl:otherwise>
</xsl:otherwise></xsl:choose>
<![CDATA[</p>
<p>Value of Modified On: ]]>
<xsl:choose><xsl:when test="systemuser/modifiedon">
<xsl:value-of select="systemuser/modifiedon" />
</xsl:when><xsl:otherwise>
</xsl:otherwise></xsl:choose>
<![CDATA[</p><p> </p></font>]]>
</xsl:template></xsl:stylesheet></body>
Try changing any reference like this (note I'm using decoded values here):
<xsl:value-of select="systemuser/createdon" />
To this
<xsl:value-of select="ms:format-date('systemuser/createdon', 'dd MMM yyyy')"/>
Once you're done, save your customisations xml back into your solution zip and upload it. Even if it works when merging, it probably won't work if you try and edit it via the CRM UI.
This comes as an idea from reading this

You need to do the following:
Download the solution
Extract the zipped filed
search for your field by the logical name. So the Modified On field would be modifiedon.
on every match, add /#date after the match. Before: modifiedon. After: modifiedon/#date
Save the file, re-zip the solution folder, import it into the system and publish all customizations.

Related

Multiple file export from excel xml schema

I'm looking for a way to export table from excel to xml but every excel line should be different xml file, not as a default one xml file with all data.
So for example table like the one below:
This table should be exported into 3 xml files
first file 1.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<student-data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<TAGNAME1>mark</TAGNAME1>
<TAGNAME2>tom</TAGNAME2>
<TAGNAME3>london</TAGNAME3>
</record>
</student-data>
second file 2.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<student-data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<TAGNAME1>julie</TAGNAME1>
<TAGNAME2>jan</TAGNAME2>
<TAGNAME3>manchester</TAGNAME3>
</record>
</student-data>
etc...
Any ideas how to do that?
I've tried to use developer mode in excel with xml tab, but it export one file with all data.
Assuming you're using an XLSX file, you'll find it's actually a zip file. In its xl/worksheets subdirectory, the sheet1.xml and similarly named files (sheet2.xml, sheet3.xml, ...) represent the tabs that you see in the Excel file.
Typically, sheet1.xml will contain something like:
<worksheet...>
...
<sheetData>
<row r="1">
<c r="A1">...</c>
<c r="B1">...</c>
</row>
<row r="2">
<c r="A2">...</c>
<c r="B2">...</c>
</row>
</sheetData>
</worksheet>
Comparing that XML to what you see in Excel, you'll quickly spot the way a worksheet is encoded in XML. The <row><c/></row> structures almost immediately translate to what you need.
Strings are typically handled in a special way.
A cell with string contents usually contains a reference to a string value specified elsewhere. In the <c> element, the attribute t="s" indicates a referenced string. (the s attribute references a style id). The <v> element contains the string reference.
The zero-indexed reference list is stored in the xl/sharedStrings.xml file. Multiple occurrences of the same string will be stored more efficiently this way (instead of keeping them inline in the cells, which could result in multiple duplicates of the same string).
Using xmlstarlet and/or XSLT combined with some BaSH scripting for loops and handling file input and output, you could then get your desired result.
This is not an instant answer to what you want, but instead a nudge in the direction you could go. Your choice of tooling may vary. You'll learn useful things along the way. Learning curves may be steep but rewarding eventually. In the end, this will probably teach you more than any precooked answer.

Is there any possible way to keep comments at a single place if it is repetitive?

I don't know but is there any possible way to keep comments at a single place if it is repetitive, in visual studio editor?
Or something like to create link in comments and if we click on that link and it jumps to bunch of commented code, so we can just write the link where it is needed to write that bunch of code. So no repetitive comments are written.
The C# compiler allows you to reference an external XML file which contains the actual comments for a method. To do this you use an <include> element in the XML doc comment
/// <include file='file.doc' path='Parent/Child[#name="member"]/*' />
The contents of file.doc need to be an XML file and the comment for that method be at the XML path described in the path element
<Parent>
<Child name="member">
<summary>The actual comment</summary>
</Child>
</Parent>
More information is available here
I do not know if Visual Studio will allow you to click and follow through to the documentation. But the correct summary will be emitted in the file XML doc file for the assembly

How to output the project properties to the build XML logs so that they can be used in XSL files?

We use cruisecontrol for our daily automatic tests. We use the JUnit framework. For every case, we have an output file other than the log file of the junit case. We add the output files to the artifact directory of the project when the build completes. We use the built-in XSL file "unittests.xsl" to publish the email results.
Recently, I want to modify the xsl file "unittests.xsl" to add a hyperlink to the output file for every case. Here is what I tried at the very beginning:
<td class="unittests-data" width="300">
<xsl:value-of select="..//#name"/>
</td>
The problem here is, the url of the output file can work when opening the result page using the web browser; but the url is incorrect in the result mail. In the mail, the url is concated as:
http://localhost:18080/cruisecontrol/buildresults/artifacts/...
But what I want is:
http://localhost:18080/cruisecontrol/artifacts/...
So I am thinking of another way to solve this. My thought was to output a property of the root url to the project logs so that the XSL file can get its value like this:
<xsl:variable name="urlroot" select="/cruisecontrol/info/property[#name='urlroot']/#value"/>
<td class="unittests-data" width="300">
<xsl:value-of select="..//#name"/>
</td>
The problem here is, the properties of the project (defined in config.xml) are not outputed to the project logs. So that I can not do it this way.
Is there any other way to achieve this? Thanks in advance.
Create a xml file to hold the properties you need to have in the CC publishing phase
Fill out the xml file with the properties during the build
Copy the file to the CC merge directory at the end of the build
Target the property values in the xsl transformer
If you echo the properties to the CC log during the build then they end up in an unpredictable location in the CC log. A reliable way is to create an xml file specifically for the stuff you need and merge it into the log at the end. Now you may reliably target the values in the xsl.
You can simply pass the properties to some antbuilde and echo them. Then when you merge your log files the property values will be in it.

Making a custom report with ccnet

So I have my output that I used the merge task to put into ccnet.
Now what I need to do is come up with my own custom xsl and output the data.
Any ideas on where there maybe a tutorial on how to do this?
For example what plugin do I need to use? Can I create my own? What does action name do?
<xslReportBuildPlugin description="MSBuild Output" actionName="MSBuildOutputBuildPlugin" xslFileName="xsl\msbuild.xsl" />
in your cruise control folder:
CruiseControl.NET\webdashboard\xsl
Copy any existing xsl (preferably one that is close to what you already want or in a format you like). you could start an xsl file from scratch also.
edit it to what you want it to be with your own file name.
I copied the msbuild.xsl to BMsBuild.xsl and made my changes.
then in dashboard.config
<xslReportBuildPlugin description="BBuildReport" actionName="BBuildReport" xslFileName="xsl\Bmsbuild.xsl"></xslReportBuildPlugin>
Description: what title you want it to have on the webdashboard link
actionName: a unique name that will be used to generate a URL for that xsl/report
xslFileName: the path to the xsl usually just xsl[your xsl file name].xsl
That's the easiest way. The file is nearly entirely xsl so there's not really anything special you need to do or know. Except that the xsl is going to target the merged xml file from whatever you have in the publishers xml logger tag in your ccnet.config
<publishers>
<statistics/>
<xmllogger logDir="D:\Projects\TFS\Main\BuildProcess\logs\ServiceBuilds" />
</publishers>

Deployment of custom content type, forms, cqwp, and xsl

Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this.
Now, I would like to do 2 things.
First, I'd like to create a custom display form for the content type and include it in my solution so that it is automatically deployed when I deploy my solution. How do I include this in my solution and make my content type use it?
Secondly, you can query this type with the CQWP. I've thought about exporting it, adding more common view fields, and then modifying the XSL that is used to render it. How do I include this into my solution so that it is also deployed. I know i can export the CQWP webpart once it's all setup and include it in my project as a feature. But what abuot the XSL?
Looking forward to see your suggestions, cheers.
Did as described in the first answer. Worked like a charm.
Use STSDev to create the solution package.
That should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.
To deploy the xslt, your feature will have an
<ElementManifest Location="mywebpartManifest.xml">
This then points to a files such as
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Yourfile.xslt" Url="Style Library" Path="" RootWebOnly="TRUE">
<File Url="yourfile.xslt" Type="GhostableInLibrary" />
</Module>
</Elements>
for the webpart:
<Module Name="myWebpart" List="113" Url="_catalogs/wp" RootWebOnly="FALSE">
<File Url="myWebpart.webpart" Type="GhostableInLibrary" />
</Module>
Now that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.
e.g.
<Resources>
<Resource Location="SimpleFeature\Feature.xml"/>
The actual schemas are:
Site
Solution
Feature
and a link to someone else with the issue
But where in the folder structure do you deploy the form and the .xsl to?
I have followed your guide and although it deploys the xslt to the feature in 12 Hive it does not place it in the correct style library folder
You need to deactivate / reactivate the feature. This will give you any error messages that are associated with copying the file over.

Resources