<?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-4235695192789220624</id><updated>2011-08-26T00:03:38.913-07:00</updated><category term='C#'/><category term='SharePoint'/><category term='STSAdm'/><title type='text'>ShareVenture</title><subtitle type='html'>A Blog for SharePoint and .Net development along with other technology stuff.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shareventure.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shareventure.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Henrique Zacchi</name><uri>http://www.blogger.com/profile/04872053528782775072</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>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4235695192789220624.post-1101779608598505754</id><published>2008-12-11T03:24:00.000-08:00</published><updated>2009-02-03T02:03:39.185-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STSAdm'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>STSAdm Case Sensitivity</title><content type='html'>One thing to be aware of when deploying a site collection feature using STSAdmin is that is that the -URL parameter is CaSe SenSitivE.&lt;br /&gt;If you don't follow this, you might get in trouble just as I did.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;STSAdm.exe -o installfeature -filename "HR_MetaData\Feature.xml" &lt;br/&gt;&lt;br /&gt;STSAdm.exe -o activatefeature -filename "HR_MetaData\Feature.xml" -url "http://MySite/sites/&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;humanresources&lt;/span&gt;"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;The error message:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;"Unknown Error"&lt;/blockquote&gt;If you have &lt;a href="http://www.graphicalwonder.com/?p=648"&gt;turned off custom Errors in Sharepoint&lt;/a&gt; you should see the following error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Object reference not set to an instance of an object.&lt;br /&gt;at Microsoft.SharePoint.ApplicationPages.FieldListRenderer.Render(HtmlTextWriter output)&lt;br /&gt;...&lt;br /&gt;...&lt;/blockquote&gt;You will see the errors above when navigating to Site Actions -&gt; Site Settings -&gt; Site Columns;&lt;br /&gt;or navigate to: http://MySite/sites/HumanResources/_layouts/mngfield.aspx&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resolution&lt;/span&gt;&lt;br /&gt;When you deploy a feature using STSAdm &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;-url&lt;/span&gt;&lt;/span&gt; make sure you take into consideration the case of the URL.&lt;br /&gt;&lt;br /&gt;After using the correct case everything worked beautifully.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;STSAdm.exe -o activatefeature -filename "HR_MetaData\Feature.xml" -url "http://MySite/sites/&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;H&lt;/span&gt;uman&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;R&lt;/span&gt;esources"&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4235695192789220624-1101779608598505754?l=shareventure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shareventure.blogspot.com/feeds/1101779608598505754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4235695192789220624&amp;postID=1101779608598505754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/1101779608598505754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/1101779608598505754'/><link rel='alternate' type='text/html' href='http://shareventure.blogspot.com/2008/12/stsadm-case-sensitivity.html' title='STSAdm Case Sensitivity'/><author><name>Henrique Zacchi</name><uri>http://www.blogger.com/profile/04872053528782775072</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4235695192789220624.post-5818440377704187518</id><published>2008-11-17T13:13:00.000-08:00</published><updated>2009-02-03T02:00:31.835-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Hide or Remove Title and other SharePoint built-in fields from a Content type using XML</title><content type='html'>I've created a feature to deploy my own SharePoint fields and Content types.&lt;br /&gt;My custom Content types inherits from either Item or Calendar and I was looking for a way to hide or Delete the standard fields "Title" for Item and "Description", "Event Date" and "End Date" for Calendar.&lt;br /&gt;My objective was to hide these fields from users when they access SharePoint's EditForm.aspx and NewForm.aspx.&lt;br /&gt;&lt;br /&gt;Here is how I've done it:&lt;br /&gt;In the Content Type definition XML you first need to remove the field using removefieldref, then add it again with the hidden tag set to true.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;contenttype id="0x010092BE5A7A635CC84081F8D4F32D3A52CD" name="Customer" group="MyGroup"&amp;gt;&lt;br /&gt;&amp;lt;fieldrefs&amp;gt;&lt;br /&gt;&amp;lt;removefieldref id="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" name="Title"&amp;gt;&lt;br /&gt;&amp;lt;fieldref id="fa564e0f-0c70-4ab9-b863-0177e6ddd247" name="Title" hidden="TRUE"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;fieldref id="20d446ef-0e0c-404f-ab4b-905732e367df" name="CustomerAddress" &amp;gt;&lt;br /&gt;&amp;lt;fieldref id="0e6b89c0-494a-4b0b-8fb0-134dd3752282" name="CustomerName"&amp;gt;&lt;br /&gt;&amp;lt;/fieldref&amp;gt;&lt;br /&gt;&amp;lt;/fieldref&amp;gt;&lt;br /&gt;&amp;lt;/fieldref&amp;gt;&amp;lt;/removefieldref&amp;gt;&lt;br /&gt;&amp;lt;/fieldrefs&amp;gt;&amp;lt;/contenttype&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Same can be applied to other SharePoint system fields (e.g.  "Event Date", "Description", etc).&lt;br /&gt;&lt;br /&gt;Whether this is a bug or standard behaviour I don't know, but from my experience you will need to use both "removefieldref" and then add the field again (fieldref) with tag hidden="TRUE". By using only one of the two it simply doesn't work. You can achieve the same results by using SharePoint UI or the programatically using the Object Model.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To get up to speed with Content Type deployment, refer to &lt;a href="http://msdn.microsoft.com/en-us/library/ms468437.aspx"&gt;Microsoft SDK Documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4235695192789220624-5818440377704187518?l=shareventure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shareventure.blogspot.com/feeds/5818440377704187518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4235695192789220624&amp;postID=5818440377704187518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/5818440377704187518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/5818440377704187518'/><link rel='alternate' type='text/html' href='http://shareventure.blogspot.com/2008/11/hide-title-and-other-sharepoint-built.html' title='Hide or Remove Title and other SharePoint built-in fields from a Content type using XML'/><author><name>Henrique Zacchi</name><uri>http://www.blogger.com/profile/04872053528782775072</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4235695192789220624.post-9157276242681632218</id><published>2008-09-23T15:26:00.002-07:00</published><updated>2009-02-02T16:09:02.035-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to modify a DateTime value in SharePoint AfterProperties</title><content type='html'>When you change a DateTime field value in SharePoint's &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.aspx"&gt;SPItemReceiver&lt;/a&gt; AfterProperties/BeforeProperties you need to set it to a specific DateTimeFormat string;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Scenario is the following:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Created a SharePoint Customer List with a number of fields, including Cancelled (checkbox) and DateCancelled (DateTime readonly);&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Created a .Net Assembly with the business logic. The business logic is simple: If user ticked the Cancelled checkbox, the DateCancelled field would be populated with the current TimeStamp;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Created a Feature Receiver to attach the assembly to the List - See &lt;a href="http://msdn.microsoft.com/en-us/library/ms453149.aspx"&gt;SDK documentation&lt;/a&gt; for detailed instructions on how to set this up;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;My first attempt:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c-sharp"&gt;&lt;br /&gt;&lt;br /&gt;class EventHandler : SPItemEventReceiver&lt;br /&gt;{&lt;br /&gt;  public override void ItemUpdating(SPItemEventProperties inProperties)&lt;br /&gt; {&lt;br /&gt;     base.ItemUpdating(inProperties);&lt;br /&gt;     .....&lt;br /&gt;     if (conditions)&lt;br /&gt;     {&lt;br /&gt;             inProperties.AfterProperties["DateCancelled"] = DateTime.Now;&lt;br /&gt;             // This also does not work&lt;br /&gt;             inProperties.AfterProperties["DateCancelled"] = DateTime.ToLongDateString();&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The error message:&lt;/b&gt;&lt;br /&gt;Invalid date/time value&lt;br /&gt;A date/time field contains invalid data. Please check the value and try again.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;My Solution:&lt;/b&gt;&lt;br /&gt;After many attempts and some googling, I found out that when setting a DateTime value in AfterProperties you have to convert the the DateTime to an ISO8601 string format - I could not find any official documentation explaining the reason for this.&lt;br /&gt;So here is how I've solved this:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="c-sharp"&gt;&lt;br /&gt;if (conditions)&lt;br /&gt;{&lt;br /&gt;     inProperties.AfterProperties["DateCancelled"] = Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now);&lt;br /&gt;     // This also works :&lt;br /&gt;     inProperties.AfterProperties["DateCancelled"] = DateTime.Now.ToString("yyyy-mm-ddThh:mm:ssZ");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4235695192789220624-9157276242681632218?l=shareventure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shareventure.blogspot.com/feeds/9157276242681632218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4235695192789220624&amp;postID=9157276242681632218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/9157276242681632218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/9157276242681632218'/><link rel='alternate' type='text/html' href='http://shareventure.blogspot.com/2008/09/how-to-modify-datetime-value-in_241.html' title='How to modify a DateTime value in SharePoint AfterProperties'/><author><name>Henrique Zacchi</name><uri>http://www.blogger.com/profile/04872053528782775072</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4235695192789220624.post-8841280807886998571</id><published>2008-09-19T07:14:00.000-07:00</published><updated>2009-02-03T01:55:28.434-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Yet another blog</title><content type='html'>My desire to create a technical blog has been around for a while but I have been putting it off cause Internet is already full of great, complete,official, accurate, excellent blogs.&lt;br /&gt;A few months back I started developing apps for SharePoint, and, for some issues I came accross I couldn't find much information out there so I thought it would be helpful to create this space and share with you my experiences and discoveries in the SharePoint world.&lt;br /&gt;&lt;br /&gt;I hope you enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4235695192789220624-8841280807886998571?l=shareventure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shareventure.blogspot.com/feeds/8841280807886998571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4235695192789220624&amp;postID=8841280807886998571' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/8841280807886998571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4235695192789220624/posts/default/8841280807886998571'/><link rel='alternate' type='text/html' href='http://shareventure.blogspot.com/2008/09/yet-another-blog.html' title='Yet another blog'/><author><name>Henrique Zacchi</name><uri>http://www.blogger.com/profile/04872053528782775072</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><thr:total>0</thr:total></entry></feed>
