<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3782172905198518472</id><updated>2012-02-16T12:16:53.897+01:00</updated><category term='SharePoint'/><title type='text'>my bits on Portals | .Net | Microsoft SharePoint | Worklfow</title><subtitle type='html'>my bits on Portals | .Net | Microsoft SharePoint | Worklfow
MOSS WSS SharePoint Custom Workflow Foundation Silverlight TamTam Sparked</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.interted.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3782172905198518472/posts/default'/><link rel='alternate' type='text/html' href='http://www.interted.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>interTed</name><uri>http://www.blogger.com/profile/16454403156741481800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3782172905198518472.post-2403297569044407248</id><published>2009-10-11T11:47:00.007+02:00</published><updated>2009-10-12T12:03:52.051+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>How to Display an updated icon with modified list items</title><content type='html'>My customer wanted to label list items that had been modified, in the same way that new list items are highlighted using the green '!New' icon.&lt;br /&gt;So this is what I came up with:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_HbhH5e0gAWw/StG4yHFgovI/AAAAAAAAAT0/hqlrqLqswD8/s1600-h/UpdatedIcon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_HbhH5e0gAWw/StG4yHFgovI/AAAAAAAAAT0/hqlrqLqswD8/s320/UpdatedIcon.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The solution I came up with was actually quite straightforward.&lt;br /&gt;First I scanned through all Field, List and Site definition files in the 12 Hyve for any occurrences of the image file new.gif. You would quickly find that the New icon is rendered using the following CAML syntax:&lt;br /&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="Created_x0020_Date"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IMG&lt;/span&gt; &lt;span class="attr"&gt;SRC&lt;/span&gt;&lt;span class="kwrd"&gt;="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/new.gif"&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;="]]&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;$Resources:core,new_gif_alttext&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA["&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;]]&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The CAML element IfNew is used against the list item column that holds the creation date. As you probably know, you can control the number of days that SharePoint should display the New icon using an Stsadm command. Let's say you need to show the icon for 5 days, you would apply that setting like this:&lt;br /&gt;&lt;b&gt;stsadm -o setproperty -pn days-to-show-new-icon -pv 5&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;But is there a CAML element that does the same for modifications? i.e. IfModified or IfUpdated. Because we need to show our Updated icon whenever a list item is modified. Well, CAML does not have an element like that available. So I thought, why cannot we use the same IfNew element in combination with the Modified item field that holds the date of the last modification. That did the trick! Basically you can throw any date column at the IfNew element!&lt;br /&gt;&lt;br /&gt;So here is the CAML code what we ended up with. This replaces the four lines of CAML syntax above wherever we needed to display the new Updated icon:&lt;br /&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IfEqual&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Expr1&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Column&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="Created_x0020_Date"&lt;/span&gt; &lt;span class="attr"&gt;Format&lt;/span&gt;&lt;span class="kwrd"&gt;="DateOnly"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Expr1&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Expr2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Column&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="Modified"&lt;/span&gt; &lt;span class="attr"&gt;Format&lt;/span&gt;&lt;span class="kwrd"&gt;="DateOnly"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Expr2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Then&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="Created_x0020_Date"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IMG&lt;/span&gt; &lt;span class="attr"&gt;SRC&lt;/span&gt;&lt;span class="kwrd"&gt;="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/new.gif"&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;="]]&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;$Resources:core,new_gif_alttext;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA["&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;]]&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Then&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Else&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="Modified"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;IMG&lt;/span&gt; &lt;span class="attr"&gt;SRC&lt;/span&gt;&lt;span class="kwrd"&gt;="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/Workfox/updated.gif"&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;&lt;span class="kwrd"&gt;="updated"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;]]&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;IfNew&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Else&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;IfEqual&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;First I check if the creation date is equal to the last modification date, because if that is the case, we want to show the New icon if the IfNew element evaluates to true against the Created_x0020_Date field.&lt;br /&gt;If the last modification date is not equal (bigger) to the creation date, we check to see if the Modified column evaluates to true against the IfNew element and in that case show the Updated icon.&lt;br /&gt;&lt;br /&gt;So all you need to do is create an icon (or use this one: &lt;img src="http://2.bp.blogspot.com/_HbhH5e0gAWw/StL-LicnnnI/AAAAAAAAAUE/7Wn2fPPKKsM/S215/Updated.GIF" /&gt; ) and replace the 4 standard lines in the first section above with the lines from the second code block. I recommend you only use this code in your own field, list or site definitions and not modify any of the the default global ONET or schema XML files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3782172905198518472-2403297569044407248?l=www.interted.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interted.com/feeds/2403297569044407248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.interted.com/2009/10/how-to-display-updated-icon-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3782172905198518472/posts/default/2403297569044407248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3782172905198518472/posts/default/2403297569044407248'/><link rel='alternate' type='text/html' href='http://www.interted.com/2009/10/how-to-display-updated-icon-with.html' title='How to Display an updated icon with modified list items'/><author><name>interTed</name><uri>http://www.blogger.com/profile/16454403156741481800</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_HbhH5e0gAWw/StG4yHFgovI/AAAAAAAAAT0/hqlrqLqswD8/s72-c/UpdatedIcon.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
