tag:blogger.com,1999:blog-24491280286429343432024-03-14T05:00:51.570+00:00How I did it - SharepointTips & Tricks for developing Sharepoint based applications.Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-2449128028642934343.post-88257743171432415452013-01-22T13:53:00.004+00:002013-01-22T13:56:22.314+00:00Color Calendar Events by column valueFirst Happy New Year for everyone, hope you've all had a wonderful holiday season.<br />
<br />
To start 2013 I bring, how to create a very nice feature for Sharepoint Calendars. How to present events with diferent colors based on a column value. There are already some nices scripts over the web on how to achieve these.Yet I tried to simplify the all procedure for easy deploy.<br />
<br />
I'll be using a standard calendar list and will repaint the events based on the Category field. The default available values are:<br />
<ul>
<li>Meeting</li>
<li>Work hours</li>
<li>Business</li>
<li>Holiday</li>
<li>Get-together</li>
<li>Gifts</li>
<li>Birthday</li>
<li>Anniversary</li>
</ul>
<div>
But you can use any other column you like.</div>
<div>
<br /></div>
<div>
The goal is to associate some CSS styles to each category, present the field in the calendar event title, grab it and apply the associated CSS.</div>
<div>
<br /></div>
<div>
Before you start, download and the following files <a href="https://docs.google.com/file/d/0BzBaIn5fuGosNnJOV2ZSRVZDYmc/edit">https://docs.google.com/file/d/0BzBaIn5fuGosNnJOV2ZSRVZDYmc/edit</a></div>
<div>
<br /></div>
<div>
Now that you have the files lets do it.<br />
<a name='more'></a></div>
<div>
<br /></div>
<br />
<b>1. Create a Calendar List</b><br />
Ok first step is easy just create a nice Calendar list in your Sharepoint application.<br />
<br />
<b>2. Create a new column to be used in the calendar title</b><br />
So I want to use the Category field as my color selector. In order to do it, I need a calculated column that merges the Title and Category field. Create a new calculated columna with the following formula<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">=Title&" ["&Category&"]"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-COUGJuIl8SE/UP6DMwYNu0I/AAAAAAAAAT0/CD5HOZvMYF0/s1600/create_calculated_column.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-COUGJuIl8SE/UP6DMwYNu0I/AAAAAAAAAT0/CD5HOZvMYF0/s320/create_calculated_column.jpg" width="273" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<b>3. Change the Calendar view</b><br />
Ok now you need to change your Calendar view, in order to show this new field instead of the Title column.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-yKsTBhYFGt4/UP6Dh6fk20I/AAAAAAAAAT8/F6CxxerMS7c/s1600/modify_view.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="311" src="http://3.bp.blogspot.com/-yKsTBhYFGt4/UP6Dh6fk20I/AAAAAAAAAT8/F6CxxerMS7c/s320/modify_view.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>4. Add JS and CSS files</b></div>
<div class="separator" style="clear: both; text-align: left;">
Open your site in Sharepoint Designer and create two directories JS and CSS.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-gHBQ86rh_Vs/UP6DzOxYxAI/AAAAAAAAAUE/_0oU4RPtuBw/s1600/create_directories.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="http://4.bp.blogspot.com/-gHBQ86rh_Vs/UP6DzOxYxAI/AAAAAAAAAUE/_0oU4RPtuBw/s320/create_directories.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
after that upload <u>calendario.js</u> into JS folder and <i>calendario.css</i> into CSS folder.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>5. Edit Sharepoint site master page</b></div>
<div class="separator" style="clear: both; text-align: left;">
Almost there, the final touch is to reference JS and CSS in the Master Page.</div>
<div class="separator" style="clear: both; text-align: left;">
Edit you v4.master page in Sharepoint Designer and add:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><link rel="stylesheet" type="text/css" href="../../css/calendarios.css"/></span> just before <span style="font-family: Courier New, Courier, monospace;"></head></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
and </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><script type="text/javascript" src="../../js/calendarios.js"></script></span> just before <span style="font-family: Courier New, Courier, monospace;"></body></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/--957coH8T98/UP6GwM3MU0I/AAAAAAAAAUY/2itH4BZxvpA/s1600/add_js.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="64" src="http://2.bp.blogspot.com/--957coH8T98/UP6GwM3MU0I/AAAAAAAAAUY/2itH4BZxvpA/s320/add_js.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-_DXT7WFQ_cQ/UP6GwHdD5HI/AAAAAAAAAUc/QWy1Gm8eipU/s1600/add_css.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="57" src="http://1.bp.blogspot.com/-_DXT7WFQ_cQ/UP6GwHdD5HI/AAAAAAAAAUc/QWy1Gm8eipU/s320/add_css.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Save the master file.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>6. Enjoy your new calendar</b></div>
<div class="separator" style="clear: both; text-align: left;">
Ok, now go back to your Sharepoint site and add some random events with diferent categories and enjoy the new colors. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-F5WHGdGFjZk/UP6HCLjzHuI/AAAAAAAAAUo/DmKy0j76nG0/s1600/daily_view.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="http://2.bp.blogspot.com/-F5WHGdGFjZk/UP6HCLjzHuI/AAAAAAAAAUo/DmKy0j76nG0/s400/daily_view.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Daily view</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-o2zp7rSBzUs/UP6HCbaxK5I/AAAAAAAAAUs/uj7nqsSs7MU/s1600/month_view.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="http://4.bp.blogspot.com/-o2zp7rSBzUs/UP6HCbaxK5I/AAAAAAAAAUs/uj7nqsSs7MU/s400/month_view.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Monthly view</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-7b0Nsb5mqx4/UP6HCcftpWI/AAAAAAAAAUw/qLsBH8t0Epo/s1600/week_view.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="http://4.bp.blogspot.com/-7b0Nsb5mqx4/UP6HCcftpWI/AAAAAAAAAUw/qLsBH8t0Epo/s400/week_view.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Weekly view</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In a future post I'll show you how to configure colors, add new values for selection color and even work with multiple calendars.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a></div>
Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com2tag:blogger.com,1999:blog-2449128028642934343.post-50019837716908761442012-12-12T21:09:00.000+00:002012-12-12T21:09:54.666+00:00Master Detail in Sharepoint (2/2)Ok, back to continue the article about creating Master Detail relationship in Sharepoint 2010.<br />
In my previous post <a href="http://howididit-sharepoint.blogspot.pt/2012/12/master-detail-in-sharepoint-12.html" target="_blank">Master Detail in Sharepoint (1/2)</a> I've shown you how to prepare the Master forms in order to view the Details of a Master item.<br />
<br />
Now you need to tweak a bit the Details table form, in order to provide an easy way for the end user to add and update Detail items. Check it out how in this article.<br />
<a name='more'></a><b><br /></b>
<div>
<b>1. Create a new Detail New Form</b><br />
Using SharePoint Designer, open your site and for the Detail table, in our case Cities, create a New Custom Form.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-7ZFu9ETtEXc/UMiQTpq4MmI/AAAAAAAAARw/4NhVIx8CMY4/s1600/new_city_form.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-7ZFu9ETtEXc/UMiQTpq4MmI/AAAAAAAAARw/4NhVIx8CMY4/s320/new_city_form.jpg" width="318" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: start;">
<b>2. Edit the new form</b></div>
<div style="text-align: start;">
Using SharePoint Designer, open your site and for the Detail table, in our case Cities and create a New Custom Form. And as explained in previous article, delete the web part and re-create it.</div>
<div style="text-align: start;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-pIg7OgrWdLc/UMiQ2O08UTI/AAAAAAAAAR8/jXU_bLbNw34/s1600/new_custom_form.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="http://1.bp.blogspot.com/-pIg7OgrWdLc/UMiQ2O08UTI/AAAAAAAAAR8/jXU_bLbNw34/s320/new_custom_form.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-kXs7J-r5okM/UMiRD6sCPAI/AAAAAAAAASE/oXt9uPd3S5g/s1600/new_custom_form_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-kXs7J-r5okM/UMiRD6sCPAI/AAAAAAAAASE/oXt9uPd3S5g/s1600/new_custom_form_2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: start;">
<b>2. Create a parameter to receive the Country ID</b></div>
<div style="text-align: start;">
Ok the goal is to fill the Country automatically with the value passed by the master form. The first step is to create a parameter, for that click Parameters in<b> Data View Tools > Options</b> menu and press <b>New Parameter</b>.</div>
<div style="text-align: start;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-btjFlIXZg1w/UMiSKW6USII/AAAAAAAAASM/NwuBKlnTsac/s1600/new_parameter.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="http://1.bp.blogspot.com/-btjFlIXZg1w/UMiSKW6USII/AAAAAAAAASM/NwuBKlnTsac/s320/new_parameter.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: start;">
Name the new parameter, in this case CountryID, make its source as <b>Query String</b> and in the Query String Variable give the form query variable, in this case CountryID again.</div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<b>3. Link the new parameter to the Country field</b></div>
<div style="text-align: start;">
Next step, is to link this parameter to the country form field. Right click the Country field and format it as <b>Text Box</b>. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-3LWVSIHdXJ4/UMiSzdJUWYI/AAAAAAAAASU/-QUnhX9nbnI/s1600/format_field.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="http://2.bp.blogspot.com/-3LWVSIHdXJ4/UMiSzdJUWYI/AAAAAAAAASU/-QUnhX9nbnI/s320/format_field.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Select the new text box and click Split to see both code and window at the same time. After that change the </div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">text="{@Country}"</span></div>
<div class="separator" style="clear: both; text-align: left;">
to</div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">text="{$CountryID}"</span></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<b>4. Hide the Country row</b></div>
<div style="text-align: start;">
To stop the user from changing the value of the Country field, the best is to hide it. I personally prefer to hide the entiry row. Add to the <b><tr></b> tag the following code: <span style="font-family: 'Courier New', Courier, monospace;">style="display:none"</span></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-JqmgcWTz-Cc/UMiUEB_2MsI/AAAAAAAAASc/Lx9USlQNcW4/s1600/hide_row.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="http://4.bp.blogspot.com/-JqmgcWTz-Cc/UMiUEB_2MsI/AAAAAAAAASc/Lx9USlQNcW4/s400/hide_row.jpg" width="400" /></a></div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
You have now prepared the New Form for adding Cities to a specific country, this form will be able to receive as a parameter the specific country.</div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
Save and close the form.</div>
<div style="text-align: start;">
<br /></div>
<div style="text-align: start;">
<b>5. Make sure the form is marked as default.</b></div>
<div style="text-align: start;">
Important step, after creating the new form make sure it is marked as default.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-JCfXfhpmFg4/UMiVruz2eyI/AAAAAAAAASs/c8xOclVGhI4/s1600/default_forms.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="http://4.bp.blogspot.com/-JCfXfhpmFg4/UMiVruz2eyI/AAAAAAAAASs/c8xOclVGhI4/s320/default_forms.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>6. Edit the Display Form for the Master table</b></div>
<div class="separator" style="clear: both; text-align: left;">
Ok the last step is to change the link in the Master Form. Go back to the Country table and edit the Display Form created in the previous article <a href="http://howididit-sharepoint.blogspot.pt/2012/12/master-detail-in-sharepoint-12.html" target="_blank">Master Detail in Sharepoint (1/2)</a>. The goal is to change the URL of the link <b>Add new item</b>. Because the default behaviour won't pass the Country ID as a parameter, resulting in adding a City without Country.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-3JjSJo_TSyg/UMiWXfS0kSI/AAAAAAAAAS0/88ncESoLHLQ/s1600/add_new_item.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="http://4.bp.blogspot.com/-3JjSJo_TSyg/UMiWXfS0kSI/AAAAAAAAAS0/88ncESoLHLQ/s320/add_new_item.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>7. Add a Content Editor Web part</b></div>
<div class="separator" style="clear: both; text-align: left;">
At the bottom of the from add a <b>Content Editor</b> Web Part.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-IrKdjd7GnIg/UMiW_iAotlI/AAAAAAAAAS8/eZsAJlU554k/s1600/content_editor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-IrKdjd7GnIg/UMiW_iAotlI/AAAAAAAAAS8/eZsAJlU554k/s320/content_editor.jpg" width="229" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b>8. Inject javascript code into the Content Editor</b></div>
<div class="separator" style="clear: both; text-align: left;">
Last step is to add a nice javascript code into the Content Editor Web Part body. Don't forget to add your site url.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"><script type="text/javascript"></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var newLink = document.getElementById('idHomePageNewItem');</span></div>
<div class="separator" style="clear: both;">
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> newLink.onclick = function(){NewItem2(event, 'http://<b><span style="color: red;"><your_site_url_here></span></b>/Lists/City/NewCity.aspx?CountryID=' + getQueryString('ID')); return false;};</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> newLink.href = "";</span></div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> function getQueryString(name)</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> {</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var query = window.location.search.substring(1);</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var parms = query.split('&');</span></div>
<div class="separator" style="clear: both;">
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> for (var i=0; i<parms.length; i++) {</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var pos = parms[i].indexOf('=');</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> if (pos > 0) {</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var key = parms[i].substring(0,pos);</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> var val = parms[i].substring(pos+1);</span></div>
<div class="separator" style="clear: both;">
<span class="Apple-tab-span" style="white-space: pre;"><span style="font-family: Courier New, Courier, monospace;"> </span></span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> if(key == name)</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> return val;</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> }</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: Courier New, Courier, monospace;"> }</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: 'Courier New', Courier, monospace;"><span style="white-space: pre;"> </span>return '';</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: 'Courier New', Courier, monospace;"> }</span></div>
<div class="separator" style="clear: both;">
<span style="font-family: 'Courier New', Courier, monospace;"></script></span></div>
<br />
<div class="separator" style="clear: both;">
Save the form and its done, now when you click in the Add new item link, the New Form City will received the Country ID, resulting in adding a new City into the opened Country. </div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-QJDE9U_GQBk/UMibDccIbwI/AAAAAAAAATQ/q5PsmkgyX0U/s1600/add_city.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="279" src="http://1.bp.blogspot.com/-QJDE9U_GQBk/UMibDccIbwI/AAAAAAAAATQ/q5PsmkgyX0U/s320/add_city.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In this case, I'll add <b>Porto </b>city to<b> Portugal</b>.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-6sZ33nzX6Fs/UMibQrRpltI/AAAAAAAAATY/z98Hm-8S-uA/s1600/added_city.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://4.bp.blogspot.com/-6sZ33nzX6Fs/UMibQrRpltI/AAAAAAAAATY/z98Hm-8S-uA/s320/added_city.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Ok it was a big article, with alot of steps if you miss any it won't work. So no rush, do it slowly and enjoy the result.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a></div>
</div>
Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com3tag:blogger.com,1999:blog-2449128028642934343.post-88578048293295493722012-12-01T17:35:00.000+00:002012-12-12T14:58:42.580+00:00Master Detail in Sharepoint (1/2)<div style="text-align: justify;">
Once again I say hi to my followers and Sharepoint fellows. Today I woke up with an urge to write about something that is always a pain in Sharepoint. The Master/Detail thing.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There is no direct way to implement a Master/Detail scenario in Sharepoint, yet I've been using a technique that is pretty simple to implement and very easy for the end user to understand.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As this requires some work, I decided to split it into two articles.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. Create the Master/Detail relation and Master Forms</div>
<div style="text-align: justify;">
2. Update the new (Detail) item link and Detail Forms.</div>
<div style="text-align: justify;">
<br /></div>
<br />
<div style="text-align: justify;">
So in this article, I will show you how to create the Master/Detail relation and change the Master Table Forms to reflect it. Check it out how.</div>
<a name='more'></a><br />
<div style="text-align: justify;">
First lets pick a classic Master/Detail scenario, the Country to City relation.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>1. Create the Master Table (Country)</b></div>
<div style="text-align: justify;">
First step, create a Custom List, name it Country and keep it with only Title Column.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>2. Create the Detail Table (Cities)</b></div>
<div style="text-align: justify;">
Create another Custom List, name it City and add an extra Lookup column called Country and reference it to the County Master Table.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>3. Add some Countries and Cities</b></div>
<div style="text-align: justify;">
In order to visualize the relation add some items to both tables.</div>
<div style="text-align: justify;">
You should end up with something like this:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-PI_BcOjyx1Q/ULSCxxrqyGI/AAAAAAAAALw/yZylkxVepO0/s1600/countries.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="http://1.bp.blogspot.com/-PI_BcOjyx1Q/ULSCxxrqyGI/AAAAAAAAALw/yZylkxVepO0/s320/countries.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Countries</i></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-OKR0Jg32-60/ULSC3G9FAZI/AAAAAAAAAL4/qGq7dBd1ciA/s1600/cities.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="http://1.bp.blogspot.com/-OKR0Jg32-60/ULSC3G9FAZI/AAAAAAAAAL4/qGq7dBd1ciA/s400/cities.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Cities</i></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>4. Create a new Master Display Form</b></div>
<div class="separator" style="clear: both; text-align: justify;">
Ok, the tables are set, now the goal is to change the Display Form of the Country Table (Master Table), in order to show the Cities of the picked Country.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
To do that, open your site in Sharepoint Designer and create a new Custom Form for Country Table and set it as default.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-Vu2qMdyol-A/ULSD9lJAhuI/AAAAAAAAAMA/khzSWHTB1OU/s1600/new_display_form.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-Vu2qMdyol-A/ULSD9lJAhuI/AAAAAAAAAMA/khzSWHTB1OU/s320/new_display_form.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>5. Create the Master webpart in the new form</b></div>
<div class="separator" style="clear: both; text-align: justify;">
Now open your newly created form, delete the existing DataFormWebPart and create a new Display Form, by using the Custom Form option. Like this:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-DtKeMo1kHYA/ULSEwZW7MpI/AAAAAAAAAMI/WcYXG1o0wGU/s1600/display_custom_form.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="http://4.bp.blogspot.com/-DtKeMo1kHYA/ULSEwZW7MpI/AAAAAAAAAMI/WcYXG1o0wGU/s320/display_custom_form.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-uKnPPmcgHVM/ULSEx1Sam_I/AAAAAAAAAMQ/gGsLY8ubYE4/s1600/display_custom_form_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-uKnPPmcgHVM/ULSEx1Sam_I/AAAAAAAAAMQ/gGsLY8ubYE4/s1600/display_custom_form_2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div style="text-align: justify;">
You maybe wondering why I do this. Why the hell I recreated the WebPart. Well Sharepoint as a weird behaviour, bug or defect don't know. Yet, if you don't do this, whenever you add a new column to the table, you won't be able to add that new column without recreating the entire Display Form. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now imagine, that you have a complex form, with several connected parts and some nice scripts and because you added a new column you now have to recreate the full thing (Won't go further, I'll discuss this issue in another article), <u>just trust me recreate the WebPart :)</u>.</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>6. Add a Data View WebPart for the City Table</b></div>
<div class="separator" style="clear: both; text-align: left;">
Just below the previous WebPart, add a Data View WebPart for the City Table. Like this:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-QivckV6UK94/ULSGBq8nAPI/AAAAAAAAAMY/rWlUzd_HhX4/s1600/data_view_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-QivckV6UK94/ULSGBq8nAPI/AAAAAAAAAMY/rWlUzd_HhX4/s1600/data_view_1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-Zb9lEjDH8AI/ULSGLQCIUuI/AAAAAAAAAMg/e_xjmryyvZM/s1600/data_view_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="http://1.bp.blogspot.com/-Zb9lEjDH8AI/ULSGLQCIUuI/AAAAAAAAAMg/e_xjmryyvZM/s400/data_view_2.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
You can remove the Country column if you wish.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>7. Connect both WebParts</b></div>
<div class="separator" style="clear: both; text-align: justify;">
As you can see, the Data View WebPart is showing all the Cities. Now we need to connect both WebParts in order to show only the Cities for the selected Country.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Select the top WebPart (the one Displaying the Coutry) and click Add Connection and configure it as following:</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Z8W1E6_6c1k/ULSJ1jx37VI/AAAAAAAAAM0/BrXi0KhxS00/s1600/add_connection_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="http://4.bp.blogspot.com/-Z8W1E6_6c1k/ULSJ1jx37VI/AAAAAAAAAM0/BrXi0KhxS00/s320/add_connection_1.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/--2QXKl02uHg/ULSJ2xbiGAI/AAAAAAAAAM8/_C8XibXjdY0/s1600/add_connection_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="http://4.bp.blogspot.com/--2QXKl02uHg/ULSJ2xbiGAI/AAAAAAAAAM8/_C8XibXjdY0/s320/add_connection_2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-aeM4TIUS8WI/ULSJ4M9BrvI/AAAAAAAAANA/343jxhWxP68/s1600/add_connection_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://4.bp.blogspot.com/-aeM4TIUS8WI/ULSJ4M9BrvI/AAAAAAAAANA/343jxhWxP68/s320/add_connection_3.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-XfErWK9mOYY/ULSJ5LJp5mI/AAAAAAAAANM/PbkVoT0SyFM/s1600/add_connection_4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="http://2.bp.blogspot.com/-XfErWK9mOYY/ULSJ5LJp5mI/AAAAAAAAANM/PbkVoT0SyFM/s320/add_connection_4.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-xIJQiRhLjR8/ULSJ6TVibkI/AAAAAAAAANU/jhQyX_QUCXI/s1600/add_connection_5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="233" src="http://3.bp.blogspot.com/-xIJQiRhLjR8/ULSJ6TVibkI/AAAAAAAAANU/jhQyX_QUCXI/s320/add_connection_5.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Now save the form and its done. </div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<u>PS: You might need to mark the created form as default again.</u></div>
<div class="separator" style="clear: both; text-align: justify;">
<u><br /></u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-jwQMqvTQSzI/ULSLLxgjo_I/AAAAAAAAANc/jG_jATG5z7c/s1600/set_default_form.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="http://2.bp.blogspot.com/-jwQMqvTQSzI/ULSLLxgjo_I/AAAAAAAAANc/jG_jATG5z7c/s400/set_default_form.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<u><br /></u></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>8. View a Country and its Cities.</b></div>
<div class="separator" style="clear: both; text-align: justify;">
Go back to your website and pick a Country, you should now see the Country item and its Cities.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-YWSwewcaaMA/ULSLVudEQ3I/AAAAAAAAANk/NKJBZk4buUw/s1600/master_detail.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="283" src="http://2.bp.blogspot.com/-YWSwewcaaMA/ULSLVudEQ3I/AAAAAAAAANk/NKJBZk4buUw/s400/master_detail.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
All done for today, in the second article I will show you how to change the way you add and update Cities for a Country.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a></div>
Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com0tag:blogger.com,1999:blog-2449128028642934343.post-38489679437775520642012-11-17T12:27:00.000+00:002012-11-17T12:27:14.729+00:00Get parent Summary Task and children tasksGood evening people, this week I've faced some nice challenge in Sharepoint 2010. Working with a Task, I needed to get the parent Summary Task of Task after it was added, changed or deleted, in order to update that same Summary Task with information about its children tasks.<br />
<br />
It took me a few hours to solve this problem, yet solved it with a simple solution. Keep reading :)<br />
<br />
<a name='more'></a><b>1. Get the parent Summary Task after adding, updating or deleting Task event</b><br />
Ok so the first step is to get the parent Summary Task, if a task is a child task of a Summary Task,<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SPFolder folder = </span><span style="font-family: 'Courier New', Courier, monospace;">properties.ListItem</span><span style="font-family: Courier New, Courier, monospace;">.Web.GetFile(properties.ListItem.Url).ParentFolder;</span><br />
<span style="font-family: Courier New, Courier, monospace;">SPListItem summaryTask = folder.Item;</span><br />
<br />
Ok so now summaryTask is your parent Summary Task item, ready to be updated with whatever needed.<br />
<br />
<b>2. Get all the children Task of the previous Summary Task</b><br />
So all items have an hidden field called FileDirRef, which points to the parent folder URL. In our case, our parent Summary Task. The idea is to execute a recursive query to the task list, filtering the field FileDirRef with the value of our added, uptaded or deleted Task FileDirRef.<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SPQuery query = new SPQuery();</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">query.Query = string.Concat(</span><span style="font-family: 'Courier New', Courier, monospace;">"<Where><Eq>",</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> "<FieldRef Name='FileDirRef'/>",</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> "<Value Type='Text'>" + </span><span style="font-family: 'Courier New', Courier, monospace;">properties.ListItem</span><span style="font-family: 'Courier New', Courier, monospace;">["FileDirRef"].ToString() + "</Value>",</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">"</Eq></Where>");</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">query.ViewAttributes = "Scope=\"Recursive\"";</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">foreach (SPListItem auxItem in properties.List.GetItems(query))</span><br />
<span style="font-family: Courier New, Courier, monospace;">{</span><br />
<span style="font-family: Courier New, Courier, monospace;"> //appply your code here</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">}</span><br />
<br />
PS: One note, this will show only the sub Task items, if in your Summary Task you have sub Summary Tasks, you can access them through <span style="font-family: Courier New, Courier, monospace;">folder.SubFolders </span>collection.<br />
<br />
<br />
Hope it helps, took me a few hours to make this 10 code lines :)<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com0tag:blogger.com,1999:blog-2449128028642934343.post-22955624739495507412012-11-14T22:08:00.000+00:002012-11-14T22:08:33.150+00:00Add summary task to task list programaticallyHello again, recently I've tried to add a summary task in a task list in an event receiver.<br />
For my surprise that turned out to be more difficult then I initially expected. Nevertheless, the solution is pretty simple.<br />
<br />
Check it out<br />
<br />
<a name='more'></a>In your event receiver apply the following code changing:<br />
<br />
<ul>
<li>The name of the Task list</li>
<li> The name of the Summary Task content type</li>
<li>URL of the Task list</li>
<li>Summary Task title</li>
</ul>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">string TaskListName = "Tasks";</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">string SummaryTaskContentType = "Summary Task";</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">string TaskListUrl = </span><span style="font-family: 'Courier New', Courier, monospace;">"{site url}/Lists/Tasks";</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">string SummaryTaskTitle = "My Summary Task";</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">SPList myList = SPContext.Current.Web.Lists[</span><span style="font-family: 'Courier New', Courier, monospace;">TaskListName</span><span style="font-family: 'Courier New', Courier, monospace;">];</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">SPContentType type = myList.ContentTypes[</span><span style="font-family: 'Courier New', Courier, monospace;">SummaryTaskContentType</span><span style="font-family: 'Courier New', Courier, monospace;">];</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">SPListItem newItem = myList.Items.Add(</span><span style="font-family: 'Courier New', Courier, monospace;">TaskListUrl</span><span style="font-family: 'Courier New', Courier, monospace;"> </span><span style="font-family: 'Courier New', Courier, monospace;">, SPFileSystemObjectType.Folder, </span><span style="font-family: 'Courier New', Courier, monospace;">SummaryTaskTitle </span><span style="font-family: 'Courier New', Courier, monospace;">);</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">newItem["ContentTypeId"] = type.Id; </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">newItem.SystemUpdate();</span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
Pretty simple isn't it ;)</div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><br /></span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a></div>
Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com0tag:blogger.com,1999:blog-2449128028642934343.post-85931723755143484692012-09-11T12:14:00.002+01:002012-09-11T12:16:37.064+01:00Dismistifying AfterProperties & BeforePropertiesHi folks, just logged for a fast writing. Everytime I need to code an event receiver I always face the problem of what to use in order to get the Changed Values and Original Values of the event Item.<br />
<br />
Guess we all know the:<br />
<br />
<ul>
<li>SPItemEventProperties.AfterProperties</li>
<li>SPItemEventProperties.BeforeProperties
</li>
<li>SPItemEventProperties.ListItem</li>
</ul>
<div>
The pain is to understand what values this properties contain in each of the events of a List or Library.</div>
<div>
Did some debugging and found nothing new, yet with a small trick in Library events.</div>
<div>
<br /></div>
<div>
Check it out ...</div>
<div>
<a name='more'></a><br /></div>
<div>
<b>1. Custom list </b></div>
<div>
<br /></div>
<div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 2.75pt; mso-padding-alt: 0cm 3.5pt 0cm 3.5pt; mso-yfti-tbllook: 1184; width: 417px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>AfterProperties<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>BeforeProperties<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ListItem<o:p></o:p></b></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemAdding<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Null<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemAdded<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemUpdating<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Original value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 4;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemUpdated<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 5;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemDeleting<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Item<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.3pt;" valign="bottom" width="94"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemDeleted<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 85.35pt;" valign="bottom" width="114"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 77.95pt;" valign="bottom" width="104"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Null<o:p></o:p></div>
</td>
</tr>
</tbody></table>
</div>
<div>
<br /></div>
<div>
<b>2. Library</b></div>
<div>
<b><br /></b></div>
<div>
<table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 2.75pt; mso-padding-alt: 0cm 3.5pt 0cm 3.5pt; mso-yfti-tbllook: 1184; width: 455px;">
<tbody>
<tr style="height: 15.0pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td nowrap="" style="border: solid windowtext 1.0pt; height: 15.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>AfterProperties<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>BeforeProperties<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-left: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ListItem<o:p></o:p></b></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 1;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemAdding<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 2;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemAdded<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 3;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemUpdating<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red;">Nothing/Original value</span><o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Original value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 4;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemUpdated<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: red;">Nothing/Original value</span><o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Changed value<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 5;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemDeleting<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Item<o:p></o:p></div>
</td>
</tr>
<tr style="height: 15.0pt; mso-yfti-irow: 6; mso-yfti-lastrow: yes;">
<td nowrap="" style="border-top: none; border: solid windowtext 1.0pt; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 70.0pt;" valign="bottom" width="93"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b>ItemDeleted<o:p></o:p></b></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 79.0pt;" valign="bottom" width="105"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 116.0pt;" valign="bottom" width="155"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
<td nowrap="" style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; height: 15.0pt; mso-border-bottom-alt: solid windowtext .5pt; mso-border-right-alt: solid windowtext .5pt; padding: 0cm 3.5pt 0cm 3.5pt; width: 76.0pt;" valign="bottom" width="101"><div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Nothing<o:p></o:p></div>
</td>
</tr>
</tbody></table>
<br />
Nothing new right? Well, before writing this article I did a web search and found a board much like this one.</div>
<div>
Yet see the change in the BeforeProperties for the Library events.</div>
<div>
<br /></div>
<div>
Why two values for the ItemUpdated and ItemUpdating? Easy enough.</div>
<div>
<br /></div>
<div>
When you add a new document to a document library the events fired are in this order: ItemAdding > ItemAdded. Until here nothing new.</div>
<div>
<br /></div>
<div>
Well right after you add a new document the EditForm pops up in order to allow you to change any properties for the document.</div>
<div>
<br /></div>
<div>
The events that are fired for this Form after you press Save are: ItemUpdating > ItemUpdated.</div>
<div>
Yet, at this moment (the moment right after you add a new document), the BeforeProperties has no usefull values like it should. In fact, it has nothing. So, not only the Update events are fired, when your are adding a new document (because infact the document is already saved), as the BeforeProperties work diferently from the standard Update action.</div>
<div>
<br /></div>
<div>
Hope it helped and saves you some time.</div>
<div>
<br /></div>
<div>
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: none;" target="_blank">How I did it - Sharepoint Foundation 2010</a>
</div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com0tag:blogger.com,1999:blog-2449128028642934343.post-28659293936561155342012-08-23T12:04:00.000+01:002012-08-23T12:06:48.849+01:00Removing HTML tags from Drop Down listHi people, got another tweak to show you.<br />
<br />
Following a previous post <a href="http://howididit-sharepoint.blogspot.pt/2012/04/filtering-lookup-columns.html">Filtering lookup columns</a> I've noticed that the selected value of a DropDown list shows HTML tags like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-JVyBnkAIw8c/UDYK_h3s0EI/AAAAAAAAALE/WiApEvUKPnE/s1600/screen1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="http://3.bp.blogspot.com/-JVyBnkAIw8c/UDYK_h3s0EI/AAAAAAAAALE/WiApEvUKPnE/s400/screen1.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Nevertheless the items in the dropdown list are ok.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-9ooIgrs4PrE/UDYLXm4UmiI/AAAAAAAAALM/NpbZvOZU_d4/s1600/screen2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="44" src="http://4.bp.blogspot.com/-9ooIgrs4PrE/UDYLXm4UmiI/AAAAAAAAALM/NpbZvOZU_d4/s400/screen2.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The question is, how to remove the HTML tags from the selected value?</div>
<a name='more'></a><b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: left;">
<b>1. Edit the form in Sharepoint Designer and Split the view</b></div>
<div class="separator" style="clear: both; text-align: left;">
Now click on your DropDown list control, the code window should now pointing to the DropDown source code.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-IAGHBvxX_XM/UDYMJkuvX4I/AAAAAAAAALU/WUhKL6j6zT0/s1600/screen3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="http://3.bp.blogspot.com/-IAGHBvxX_XM/UDYMJkuvX4I/AAAAAAAAALU/WUhKL6j6zT0/s400/screen3.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>2. Edit the selectedvalue tag</b></div>
<div class="separator" style="clear: both; text-align: left;">
You can now see that the tag selectedvalue is pointing to the Field Name, in my case "Tabela1".</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">selectedvalue="{@Tabela1}"</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
What you have to do is just changing this part of the code to</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">selectedvalue="{substring-before(substring-after(@Tabela1, '&gt;'), '&lt;')}"</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And voilá save the form and try it out.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-IngSLn5BVWE/UDYNHo38umI/AAAAAAAAALc/4S-uuAsXogY/s1600/screen4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="211" src="http://1.bp.blogspot.com/-IngSLn5BVWE/UDYNHo38umI/AAAAAAAAALc/4S-uuAsXogY/s400/screen4.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Just one note "Tabela1" is the field name, just change it to your case.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-decoration: none;" target="_blank">How I did it - Sharepoint Foundation 2010</a>
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com9tag:blogger.com,1999:blog-2449128028642934343.post-29733881462524001452012-07-30T16:15:00.001+01:002012-07-31T15:45:18.844+01:00Add a new file typeOk here is another nice tip. I recently needed to add to the context menu (ECB menu) of a file the "Edit in ..." command. Basically, if the native application is WebDav compatible I want to be able to edit any file for the referenced application, just from the browser, instead of navigating throw the Explorer View. (This will only work for Internet Explorer)<br />
<div>
<div>
<br /></div>
<div>
Like this:</div>
<div>
<br />
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-_a2_qz2fodQ/UBakEvgToAI/AAAAAAAAAKk/Rp4Z5GXf_o0/s1600/after.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="190" src="http://3.bp.blogspot.com/-_a2_qz2fodQ/UBakEvgToAI/AAAAAAAAAKk/Rp4Z5GXf_o0/s400/after.jpg" width="400" /></a></div>
Check it out, this is pretty fast yet very helpfull.</div>
<div>
<a name='more'></a><b>1. Create an icon file</b></div>
<div>
Use your favorite image editor to create an image file with 16x16, preferebly PNG format.</div>
<div>
And save the image file into the server folder %COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES</div>
<div>
<br /></div>
<div>
<b>2. Edit the DOCICON.XML file </b>(backup the file first ;-))</div>
<div>
Next open, using your favorite text editor, the <b>docicon.xml</b> file located in the server folder %COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML.</div>
<div>
<br /></div>
<div>
Add one line for each file type like this:</div>
<div>
<br /></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><Mapping Key="pdf" Value="pdf.png" EditText="PDF-XChange Viewer" OpenControl="SharePoint.OpenDocuments"/></span></div>
<div>
<br /></div>
<div>
Just change:</div>
<div>
<ul>
<li>Key="pdf" to Key="your_file_extension"</li>
<li>Value="pdf.png" to Key="image_file_name" (created in first step)</li>
<li>EditText="PDF-XChange Viewer" to Edit="name_of_the_native_application" (this is the name that will appear in the context menu (ECB)</li>
</ul>
<div>
<b>3. Reset server and try</b></div>
</div>
<div>
All done, just <b>iisreset </b>your server and try it.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-5cwS5f-Xzg0/UBakoMBMv1I/AAAAAAAAAKs/kXCa_p40uug/s1600/new_file_type.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="321" src="http://2.bp.blogspot.com/-5cwS5f-Xzg0/UBakoMBMv1I/AAAAAAAAAKs/kXCa_p40uug/s400/new_file_type.jpg" width="400" /></a></div>
<div>
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: left;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: left; text-decoration: none;" target="_blank">How I did it - Sharepoint Foundation 2010</a>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
</div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com13tag:blogger.com,1999:blog-2449128028642934343.post-86323597977871218402012-06-15T14:56:00.001+01:002012-06-15T14:56:55.998+01:00Explorer view is too slowOk I've passed the last day and a half trying to find a solution for a know problem.<br />
<br />
Some users, were facing huge low performance copying files to a Document Library in Explorer View. After alot of web surfing without getting anywhere I add a sparkle idea that worked finally.<br />
<br />
Check it out.<br />
<br />
<a name='more'></a><b>1. Typical solution: Disable the "Automatically Detect Settings" from IE</b><br />
Ok this is the typical cause of the problem WebDav protocol and the feature for proxy automatic detection don't like each other.<br />
<br />
Open IE and go to Tools->Internet Options->Connections->LAN settings uncheck "Automatically Detect Settings". Like this:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-swF92ZxL1QI/T9s8dA4KhjI/AAAAAAAAAKA/ewDfUGOk29A/s1600/ie_settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="http://2.bp.blogspot.com/-swF92ZxL1QI/T9s8dA4KhjI/AAAAAAAAAKA/ewDfUGOk29A/s400/ie_settings.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Ok, if this doesn't solve your problem, like it happened to me check next solution</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>2. Anti-virus solutions is messing with WebDavAV traffic</b></div>
After burning my eyebrows and almost in tears, I disabled my anti-virus realtime protection. In my case Kaspersky. Surprisingly, Explorer View went live almost immediately.<br />
<br />
As I want anti-virus realtime protection, I started to disable parts of that protection and found out that "IM anti-virus protection" was the problem. Yet, this only happens in Kaspersky 2012<br />
<br />
If you are using Kaspersky 2012, or your antivirus as also IM protection. Do one of the following:<br />
<br />
<u>Disable IM Protection</u><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-HFArcQNngmo/T9s-ELnbptI/AAAAAAAAAKI/qY7B96cHwVg/s1600/im_disabled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="http://1.bp.blogspot.com/-HFArcQNngmo/T9s-ELnbptI/AAAAAAAAAKI/qY7B96cHwVg/s400/im_disabled.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Enable IM protection only for inboud messages</u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-S-lI8vFPX3w/T9s-SINIpTI/AAAAAAAAAKQ/WgOMltjvzCA/s1600/im_enabled.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="291" src="http://3.bp.blogspot.com/-S-lI8vFPX3w/T9s-SINIpTI/AAAAAAAAAKQ/WgOMltjvzCA/s400/im_enabled.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hope it helps and saves you time, after all unticking one small check box took me a few hours, lol.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you want to keep in touch, feel free to Subscribe to <a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" target="_blank">How I did it - Sharepoint Foundation 2010</a>
</div>
<div class="separator" style="clear: both; text-align: left;">
<u><br /></u></div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com6tag:blogger.com,1999:blog-2449128028642934343.post-55976492422412613542012-06-13T08:34:00.000+01:002012-06-13T08:34:32.410+01:00Format Date in Custom Display Form<div>
Hi guys, here is another nice trick that took me a while to get.<br />
<br />
Imagine you have a list with a Date field, only showing date value, not Time. If you create a Custom Display Form in Sharepoint Designer, you wiill see something incredible.<br />
<br />
<ol>
<li>Date field shows Time value</li>
<li>Date field shows less 1 hour, which might lead to show one less day in date value</li>
</ol>
<div>
Just like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Hn-yG6mSt8A/T9cGTcI-OCI/AAAAAAAAAJk/phMbC6-QPy4/s1600/date_format_error.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="http://2.bp.blogspot.com/-Hn-yG6mSt8A/T9cGTcI-OCI/AAAAAAAAAJk/phMbC6-QPy4/s400/date_format_error.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Ok the goal is to format the date value, check how I did it.</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a href="" name="more"></a><b></b><br />
<a name='more'></a><br />
<b>1. Edit your custom form in Sharepoint Designer</b><br />
<div>
Open your custom form in Sharepoint Designer and select the date value.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-J7QUvqY1lEA/T9cIh6pUhPI/AAAAAAAAAJs/YqcK_NIIjm0/s1600/sharepoint_designer.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="http://1.bp.blogspot.com/-J7QUvqY1lEA/T9cIh6pUhPI/AAAAAAAAAJs/YqcK_NIIjm0/s400/sharepoint_designer.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b>2. Add a format Formula </b></div>
<div class="separator" style="clear: both; text-align: left;">
Click the Formula button and write the following Formula:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: 'Courier New', Courier, monospace;">ddwrt:FormatDate(string(@Date), 1033, 1)</span></div>
<div>
<ul>
<li>Don't forget to use the string function!! Will give you an error in XPath bla bla bla...</li>
<li>1033 is the locale code, check other locale codes here <a href="http://howididit-sharepoint.blogspot.pt/2012/06/list-of-locale-codes.html" target="_blank">List of Locale Codes</a></li>
<li>1 is the date format, the possible values are 1, 4, 5, 7,12, 13 or 15, each represent a different date format, pick the one that suites you better.</li>
</ul>
</div>
<div>
<b>3. Save the custom form and its done</b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-fykqZCyO1hY/T9cJgspTkJI/AAAAAAAAAJ0/39GZnfT9vqo/s1600/solution.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="268" src="http://1.bp.blogspot.com/-fykqZCyO1hY/T9cJgspTkJI/AAAAAAAAAJ0/39GZnfT9vqo/s400/solution.jpg" width="400" /></a></div>
<div>
<span style="text-align: left;"><br /></span><br />
<span style="text-align: left;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="text-align: left;" target="_blank">How I did it - Sharepoint Foundation 2010</a>
</div>
</div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com3tag:blogger.com,1999:blog-2449128028642934343.post-22501426745262588762012-06-12T10:28:00.004+01:002013-03-07T18:24:16.918+00:00List of Locale Codes<br />
Use the LCID Dec values for the FormatDate function.<br />
<a name='more'></a><br />
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; border: 1px solid rgb(204, 204, 204); margin-bottom: 15px; margin-top: 10px;"><thead>
<tr style="background-color: #99ccff;" valign="top"><td id="colEBB"><strong>Language - Country/Region</strong></td><td id="colEEB"><strong>LCID Hex</strong></td><td id="colEHB"><strong>LCID Dec</strong></td></tr>
</thead><tbody>
<tr valign="top"><td>Afrikaans - South Africa</td><td>0436</td><td>1078</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Albanian - Albania</td><td>041c</td><td>1052</td></tr>
<tr align="left" valign="top"><td>Alsatian</td><td>0484</td><td>1156</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Amharic - Ethiopia</td><td>045e</td><td>1118</td></tr>
<tr valign="top"><td>Arabic - Saudi Arabia</td><td>0401</td><td>1025</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Algeria</td><td>1401</td><td>5121</td></tr>
<tr valign="top"><td>Arabic - Bahrain</td><td>3c01</td><td>15361</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Egypt</td><td>0c01</td><td>3073</td></tr>
<tr valign="top"><td>Arabic - Iraq</td><td>0801</td><td>2049</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Jordan</td><td>2c01</td><td>11265</td></tr>
<tr valign="top"><td>Arabic - Kuwait</td><td>3401</td><td>13313</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Lebanon</td><td>3001</td><td>12289</td></tr>
<tr valign="top"><td>Arabic - Libya</td><td>1001</td><td>4097</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Morocco</td><td>1801</td><td>6145</td></tr>
<tr valign="top"><td>Arabic - Oman</td><td>2001</td><td>8193</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Qatar</td><td>4001</td><td>16385</td></tr>
<tr valign="top"><td>Arabic - Syria</td><td>2801</td><td>10241</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Tunisia</td><td>1c01</td><td>7169</td></tr>
<tr valign="top"><td>Arabic - U.A.E.</td><td>3801</td><td>14337</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Arabic - Yemen</td><td>2401</td><td>9217</td></tr>
<tr valign="top"><td>Armenian - Armenia</td><td>042b</td><td>1067</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Assamese</td><td>044d</td><td>1101</td></tr>
<tr valign="top"><td>Azeri (Cyrillic)</td><td>082c</td><td>2092</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Azeri (Latin)</td><td>042c</td><td>1068</td></tr>
<tr align="left" valign="top"><td>Bashkir</td><td>046d</td><td>1133</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Basque</td><td>042d</td><td>1069</td></tr>
<tr valign="top"><td>Belarusian</td><td>0423</td><td>1059</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Bengali (India)</td><td>0445</td><td>1093</td></tr>
<tr valign="top"><td>Bengali (Bangladesh)</td><td>0845</td><td>2117</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Bosnian (Bosnia/Herzegovina)</td><td>141A</td><td>5146</td></tr>
<tr align="left" valign="top"><td>Breton</td><td>047e</td><td>1150</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Bulgarian</td><td>0402</td><td>1026</td></tr>
<tr valign="top"><td>Burmese</td><td>0455</td><td>1109</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Catalan</td><td>0403</td><td>1027</td></tr>
<tr valign="top"><td>Cherokee - United States</td><td>045c</td><td>1116</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Chinese - People's Republic of China</td><td>0804</td><td>2052</td></tr>
<tr valign="top"><td>Chinese - Singapore</td><td>1004</td><td>4100</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Chinese - Taiwan</td><td>0404</td><td>1028</td></tr>
<tr valign="top"><td>Chinese - Hong Kong SAR</td><td>0c04</td><td>3076</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Chinese - Macao SAR</td><td>1404</td><td>5124</td></tr>
<tr align="left" valign="top"><td>Corsican</td><td>0483</td><td>1155</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Croatian</td><td>041a</td><td>1050</td></tr>
<tr valign="top"><td>Croatian (Bosnia/Herzegovina)</td><td>101a</td><td>4122</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Czech</td><td>0405</td><td>1029</td></tr>
<tr valign="top"><td>Danish</td><td>0406</td><td>1030</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Dari</td><td>048c</td><td>1164</td></tr>
<tr valign="top"><td>Divehi</td><td>0465</td><td>1125</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Dutch - Netherlands</td><td>0413</td><td>1043</td></tr>
<tr valign="top"><td>Dutch - Belgium</td><td>0813</td><td>2067</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Edo</td><td>0466</td><td>1126</td></tr>
<tr valign="top"><td>English - United States</td><td>0409</td><td>1033</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - United Kingdom</td><td>0809</td><td>2057</td></tr>
<tr valign="top"><td>English - Australia</td><td>0c09</td><td>3081</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Belize</td><td>2809</td><td>10249</td></tr>
<tr valign="top"><td>English - Canada</td><td>1009</td><td>4105</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Caribbean</td><td>2409</td><td>9225</td></tr>
<tr valign="top"><td>English - Hong Kong SAR</td><td>3c09</td><td>15369</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - India</td><td>4009</td><td>16393</td></tr>
<tr valign="top"><td>English - Indonesia</td><td>3809</td><td>14345</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Ireland</td><td>1809</td><td>6153</td></tr>
<tr valign="top"><td>English - Jamaica</td><td>2009</td><td>8201</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Malaysia</td><td>4409</td><td>17417</td></tr>
<tr valign="top"><td>English - New Zealand</td><td>1409</td><td>5129</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Philippines</td><td>3409</td><td>13321</td></tr>
<tr valign="top"><td>English - Singapore</td><td>4809</td><td>18441</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - South Africa</td><td>1c09</td><td>7177</td></tr>
<tr valign="top"><td>English - Trinidad</td><td>2c09</td><td>11273</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>English - Zimbabwe</td><td>3009</td><td>12297</td></tr>
<tr valign="top"><td>Estonian</td><td>0425</td><td>1061</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Faroese</td><td>0438</td><td>1080</td></tr>
<tr valign="top"><td>Farsi</td><td>0429</td><td>1065</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Filipino</td><td>0464</td><td>1124</td></tr>
<tr valign="top"><td>Finnish</td><td>040b</td><td>1035</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - France</td><td>040c</td><td>1036</td></tr>
<tr valign="top"><td>French - Belgium</td><td>080c</td><td>2060</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Cameroon</td><td>2c0c</td><td>11276</td></tr>
<tr valign="top"><td>French - Canada</td><td>0c0c</td><td>3084</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Democratic Rep. of Congo</td><td>240c</td><td>9228</td></tr>
<tr valign="top"><td>French - Cote d'Ivoire</td><td>300c</td><td>12300</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Haiti</td><td>3c0c</td><td>15372</td></tr>
<tr valign="top"><td>French - Luxembourg</td><td>140c</td><td>5132</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Mali</td><td>340c</td><td>13324</td></tr>
<tr valign="top"><td>French - Monaco</td><td>180c</td><td>6156</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Morocco</td><td>380c</td><td>14348</td></tr>
<tr valign="top"><td>French - North Africa</td><td>e40c</td><td>58380</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Reunion</td><td>200c</td><td>8204</td></tr>
<tr valign="top"><td>French - Senegal</td><td>280c</td><td>10252</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>French - Switzerland</td><td>100c</td><td>4108</td></tr>
<tr valign="top"><td>French - West Indies</td><td>1c0c</td><td>7180</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Frisian - Netherlands</td><td>0462</td><td>1122</td></tr>
<tr valign="top"><td>Fulfulde - Nigeria</td><td>0467</td><td>1127</td></tr>
<tr valign="top"><td>Galician</td><td>0456</td><td>1110</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Georgian</td><td>0437</td><td>1079</td></tr>
<tr valign="top"><td>German - Germany</td><td>0407</td><td>1031</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>German - Austria</td><td>0c07</td><td>3079</td></tr>
<tr valign="top"><td>German - Liechtenstein</td><td>1407</td><td>5127</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>German - Luxembourg</td><td>1007</td><td>4103</td></tr>
<tr valign="top"><td>German - Switzerland</td><td>0807</td><td>2055</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Greek</td><td>0408</td><td>1032</td></tr>
<tr align="left" valign="top"><td>Greenlandic</td><td>046f</td><td>1135</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Guarani - Paraguay</td><td>0474</td><td>1140</td></tr>
<tr valign="top"><td>Gujarati</td><td>0447</td><td>1095</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Hausa - Nigeria</td><td>0468</td><td>1128</td></tr>
<tr valign="top"><td>Hawaiian - United States</td><td>0475</td><td>1141</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Hebrew</td><td>040d</td><td>1037</td></tr>
<tr valign="top"><td>Hindi</td><td>0439</td><td>1081</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Hungarian</td><td>040e</td><td>1038</td></tr>
<tr valign="top"><td>Ibibio - Nigeria</td><td>0469</td><td>1129</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Icelandic</td><td>040f</td><td>1039</td></tr>
<tr valign="top"><td>Igbo - Nigeria</td><td>0470</td><td>1136</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Indonesian</td><td>0421</td><td>1057</td></tr>
<tr valign="top"><td>Inuktitut</td><td>045d</td><td>1117</td></tr>
<tr align="left" style="background-color: #e9e9e6;" valign="top"><td>Irish</td><td>083c</td><td>2108</td></tr>
<tr valign="top"><td>Italian - Italy</td><td>0410</td><td>1040</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Italian - Switzerland</td><td>0810</td><td>2064</td></tr>
<tr valign="top"><td>Japanese</td><td>0411</td><td>1041</td></tr>
<tr align="left" style="background-color: #e9e9e6;" valign="top"><td>K'iche</td><td>0486</td><td>1158</td></tr>
<tr valign="top"><td>Kannada</td><td>044b</td><td>1099</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Kanuri - Nigeria</td><td>0471</td><td>1137</td></tr>
<tr valign="top"><td>Kashmiri</td><td>0860</td><td>2144</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Kashmiri (Arabic)</td><td>0460</td><td>1120</td></tr>
<tr valign="top"><td>Kazakh</td><td>043f</td><td>1087</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Khmer</td><td>0453</td><td>1107</td></tr>
<tr align="left" valign="top"><td>Kinyarwanda</td><td>0487</td><td>1159</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Konkani</td><td>0457</td><td>1111</td></tr>
<tr valign="top"><td>Korean</td><td>0412</td><td>1042</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Kyrgyz (Cyrillic)</td><td>0440</td><td>1088</td></tr>
<tr valign="top"><td>Lao</td><td>0454</td><td>1108</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Latin</td><td>0476</td><td>1142</td></tr>
<tr valign="top"><td>Latvian</td><td>0426</td><td>1062</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Lithuanian</td><td>0427</td><td>1063</td></tr>
<tr align="left" valign="top"><td>Luxembourgish</td><td>046e</td><td>1134</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Macedonian</td><td>042f</td><td>1071</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Malay - Malaysia</td><td>043e</td><td>1086</td></tr>
<tr valign="top"><td>Malay - Brunei Darussalam</td><td>083e</td><td>2110</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Malayalam</td><td>044c</td><td>1100</td></tr>
<tr valign="top"><td>Maltese</td><td>043a</td><td>1082</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Manipuri</td><td>0458</td><td>1112</td></tr>
<tr valign="top"><td>Maori - New Zealand</td><td>0481</td><td>1153</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Mapudungun</td><td>0471</td><td>1146</td></tr>
<tr valign="top"><td>Marathi</td><td>044e</td><td>1102</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Mohawk</td><td>047c</td><td>1148</td></tr>
<tr valign="top"><td>Mongolian (Cyrillic)</td><td>0450</td><td>1104</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Mongolian (Mongolian)</td><td>0850</td><td>2128</td></tr>
<tr valign="top"><td>Nepali</td><td>0461</td><td>1121</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Nepali - India</td><td>0861</td><td>2145</td></tr>
<tr valign="top"><td>Norwegian (Bokmål)</td><td>0414</td><td>1044</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Norwegian (Nynorsk)</td><td>0814</td><td>2068</td></tr>
<tr valign="top"><td>Occitan</td><td>0482</td><td>1154</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Oriya</td><td>0448</td><td>1096</td></tr>
<tr valign="top"><td>Oromo</td><td>0472</td><td>1138</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Papiamentu</td><td>0479</td><td>1145</td></tr>
<tr valign="top"><td>Pashto</td><td>0463</td><td>1123</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Polish</td><td>0415</td><td>1045</td></tr>
<tr valign="top"><td>Portuguese - Brazil</td><td>0416</td><td>1046</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Portuguese - Portugal</td><td>0816</td><td>2070</td></tr>
<tr valign="top"><td>Punjabi</td><td>0446</td><td>1094</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Punjabi (Pakistan)</td><td>0846</td><td>2118</td></tr>
<tr valign="top"><td>Quecha - Bolivia</td><td>046B</td><td>1131</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Quecha - Ecuador</td><td>086B</td><td>2155</td></tr>
<tr valign="top"><td>Quecha - Peru</td><td>0C6B</td><td>3179</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Rhaeto-Romanic</td><td>0417</td><td>1047</td></tr>
<tr valign="top"><td>Romanian</td><td>0418</td><td>1048</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Romanian - Moldava</td><td>0818</td><td>2072</td></tr>
<tr valign="top"><td>Russian</td><td>0419</td><td>1049</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Russian - Moldava</td><td>0819</td><td>2073</td></tr>
<tr valign="top"><td>Sami (Lappish)</td><td>043b</td><td>1083</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Sanskrit</td><td>044f</td><td>1103</td></tr>
<tr valign="top"><td>Scottish Gaelic</td><td>043c</td><td>1084</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Sepedi</td><td>046c</td><td>1132</td></tr>
<tr valign="top"><td>Serbian (Cyrillic)</td><td>0c1a</td><td>3098</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Serbian (Latin)</td><td>081a</td><td>2074</td></tr>
<tr valign="top"><td>Sindhi - India</td><td>0459</td><td>1113</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Sindhi - Pakistan</td><td>0859</td><td>2137</td></tr>
<tr valign="top"><td>Sinhalese - Sri Lanka</td><td>045b</td><td>1115</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Slovak</td><td>041b</td><td>1051</td></tr>
<tr valign="top"><td>Slovenian</td><td>0424</td><td>1060</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Somali</td><td>0477</td><td>1143</td></tr>
<tr valign="top"><td>Sorbian</td><td>042e</td><td>1070</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Spain (Modern Sort)</td><td>0c0a</td><td>3082</td></tr>
<tr valign="top"><td>Spanish - Spain (Traditional Sort)</td><td>040a</td><td>1034</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Argentina</td><td>2c0a</td><td>11274</td></tr>
<tr valign="top"><td>Spanish - Bolivia</td><td>400a</td><td>16394</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Chile</td><td>340a</td><td>13322</td></tr>
<tr valign="top"><td>Spanish - Colombia</td><td>240a</td><td>9226</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Costa Rica</td><td>140a</td><td>5130</td></tr>
<tr valign="top"><td>Spanish - Dominican Republic</td><td>1c0a</td><td>7178</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Ecuador</td><td>300a</td><td>12298</td></tr>
<tr valign="top"><td>Spanish - El Salvador</td><td>440a</td><td>17418</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Guatemala</td><td>100a</td><td>4106</td></tr>
<tr valign="top"><td>Spanish - Honduras</td><td>480a</td><td>18442</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Latin America</td><td>580a</td><td>22538</td></tr>
<tr valign="top"><td>Spanish - Mexico</td><td>080a</td><td>2058</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Nicaragua</td><td>4c0a</td><td>19466</td></tr>
<tr valign="top"><td>Spanish - Panama</td><td>180a</td><td>6154</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Paraguay</td><td>3c0a</td><td>15370</td></tr>
<tr valign="top"><td>Spanish - Peru</td><td>280a</td><td>10250</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Puerto Rico</td><td>500a</td><td>20490</td></tr>
<tr valign="top"><td>Spanish - United States</td><td>540a</td><td>21514</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Spanish - Uruguay</td><td>380a</td><td>14346</td></tr>
<tr valign="top"><td>Spanish - Venezuela</td><td>200a</td><td>8202</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Sutu</td><td>0430</td><td>1072</td></tr>
<tr valign="top"><td>Swahili</td><td>0441</td><td>1089</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Swedish</td><td>041d</td><td>1053</td></tr>
<tr valign="top"><td>Swedish - Finland</td><td>081d</td><td>2077</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Syriac</td><td>045a</td><td>1114</td></tr>
<tr valign="top"><td>Tajik</td><td>0428</td><td>1064</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Tamazight (Arabic)</td><td>045f</td><td>1119</td></tr>
<tr valign="top"><td>Tamazight (Latin)</td><td>085f</td><td>2143</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Tamil</td><td>0449</td><td>1097</td></tr>
<tr valign="top"><td>Tatar</td><td>0444</td><td>1092</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Telugu</td><td>044a</td><td>1098</td></tr>
<tr valign="top"><td>Thai</td><td>041e</td><td>1054</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Tibetan - Bhutan</td><td>0851</td><td>2129</td></tr>
<tr valign="top"><td>Tibetan - People's Republic of China</td><td>0451</td><td>1105</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Tigrigna - Eritrea</td><td>0873</td><td>2163</td></tr>
<tr valign="top"><td>Tigrigna - Ethiopia</td><td>0473</td><td>1139</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Tsonga</td><td>0431</td><td>1073</td></tr>
<tr valign="top"><td>Tswana</td><td>0432</td><td>1074</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Turkish</td><td>041f</td><td>1055</td></tr>
<tr valign="top"><td>Turkmen</td><td>0442</td><td>1090</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Uighur - China</td><td>0480</td><td>1152</td></tr>
<tr valign="top"><td>Ukrainian</td><td>0422</td><td>1058</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Urdu</td><td>0420</td><td>1056</td></tr>
<tr valign="top"><td>Urdu - India</td><td>0820</td><td>2080</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Uzbek (Cyrillic)</td><td>0843</td><td>2115</td></tr>
<tr valign="top"><td>Uzbek (Latin)</td><td>0443</td><td>1091</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Venda</td><td>0433</td><td>1075</td></tr>
<tr valign="top"><td>Vietnamese</td><td>042a</td><td>1066</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Welsh</td><td>0452</td><td>1106</td></tr>
<tr valign="top"><td>Wolof</td><td>0488</td><td>1160</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Xhosa</td><td>0434</td><td>1076</td></tr>
<tr valign="top"><td>Yakut</td><td>0485</td><td>1157</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Yi</td><td>0478</td><td>1144</td></tr>
<tr valign="top"><td>Yiddish</td><td>043d</td><td>1085</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>Yoruba</td><td>046a</td><td>1130</td></tr>
<tr valign="top"><td>Zulu</td><td>0435</td><td>1077</td></tr>
<tr style="background-color: #e9e9e6;" valign="top"><td>HID (Human Interface Device)</td><td>04ff</td><td>1279</td></tr>
</tbody></table>
List copied from <a href="http://msdn.microsoft.com/en-us/goglobal/bb964664" target="_blank">http://msdn.microsoft.com/en-us/goglobal/bb964664</a>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com3tag:blogger.com,1999:blog-2449128028642934343.post-9900199781150712262012-06-05T13:40:00.000+01:002012-06-12T11:40:06.056+01:00SharePoint 2010: Hide Recently ModifiedHi again, after a long wait. Saddly last month couldn't free some time to write a bit. Nevertheless I'm back and with some new tips that will post in the following days.<br />
<br />
So the first one is to show, how can you hide the Recently Modified box from the Quick Launch area, in a Wiki Page Library.<br />
<br />
<strong>Create a new site with a Wiki Page Library</strong><br />
You should get something like this<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-wZMgjn8H3E8/T83VC8vJvvI/AAAAAAAAAJI/hFAzUmzjAck/s1600/screen1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="http://3.bp.blogspot.com/-wZMgjn8H3E8/T83VC8vJvvI/AAAAAAAAAJI/hFAzUmzjAck/s320/screen1.jpg" width="320" /></a></div>
As you can see there is a, sometimes, annoying Recently Modified box in the Quick Launch.<br />
<br />
So check how to hide it in 2 easy steps.<br />
<br />
<a name='more'></a><br />
<strong>1. Edit Master page in Sharepoint Designer</strong><br />
Ok open your site, go to Master Pages and edit the file V4.master in Code view<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-GSwplBnIGQs/T83VyXfw8SI/AAAAAAAAAJQ/y2w_T3perqc/s1600/screen2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-GSwplBnIGQs/T83VyXfw8SI/AAAAAAAAAJQ/y2w_T3perqc/s320/screen2.jpg" width="310" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<strong>2. Paste the following in code between Head tag</strong></div>
<div class="separator" style="clear: both; text-align: left;">
Ok now paste this code anywhere between the tag Head and save the changes</div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;"> <style type="text/css"><br /> .s4-recentchanges<br /> {<br /> display:none;<br /> }<br /> </style></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<strong>3. YAY!!! Refresh your site and its done.</strong></div>
<div class="separator" style="clear: both; text-align: center;">
<img border="0" height="362" src="http://1.bp.blogspot.com/-9rKNYLNFteY/T83Wk5qrVDI/AAAAAAAAAJY/zMKt12Ayj-I/s400/screen3.jpg" width="400" /></div>
<div class="separator" style="clear: both; text-align: left;">
If you want to keep in touch, feel free to Subscribe to <a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" target="_blank">How I did it - Sharepoint Foundation 2010</a></div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com11tag:blogger.com,1999:blog-2449128028642934343.post-67517410053417861812012-04-09T19:18:00.000+01:002012-04-09T19:18:03.662+01:00Filtering lookup columns<div style="text-align: justify;">
Good day all, I bring you another tweak for Sharepoint. In
<a href="http://howididit-sharepoint.blogspot.pt/2012/04/sharepoint-2010-and-cascade-lookups.html" target="_blank">Sharepoint 2010 and Cascade Lookups</a> I've shown you how to filter a lookup column based on the value of another. Now, what if you want to filter a column, based on a query of the source list?<br />
There are plenty of options over the web on how to do it using third-party tools. In my opinion it is always good to avoid that. Why? Well in the past I had huge problems with third-party tools, specially restoring sites with those features. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So, now, I always try to avoid third-party tools unless I've no other option.</div>
<div style="text-align: justify;">
Check how I filter columns based on queries in 6 easy steps:</div>
<div>
<a name='more'></a><h3>
<b><br /></b></h3>
<h3>
<b>Problem description</b></h3>
</div>
<div>
Ok you have two lists connectec by a lookup column:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-lnb4z-bz3s8/T4L7p2qCYPI/AAAAAAAAAFk/5doQh5Ovqi4/s1600/list1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-lnb4z-bz3s8/T4L7p2qCYPI/AAAAAAAAAFk/5doQh5Ovqi4/s1600/list1.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>List 1</b>: Parent list</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-t7I9se6BR3s/T4L7qqptp5I/AAAAAAAAAFs/Wg17eWPr56M/s1600/list2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-t7I9se6BR3s/T4L7qqptp5I/AAAAAAAAAFs/Wg17eWPr56M/s1600/list2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<b>List 2</b>: Child list connected to List 1 by ColumnA column</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
And now, when you are adding or editing a new item in <b>List 2</b>, you want to allow only to pick <b>List 1</b> Active items.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<h3>
<b>Solution</b></h3>
<div class="separator" style="clear: both; text-align: justify;">
<b>1. Open your site in Sharepoint Designer</b></div>
<div class="separator" style="clear: both; text-align: justify;">
The first step is to open your Sharepoint site in Sharepoint Designer 2010.</div>
<div class="separator" style="clear: both; text-align: justify;">
In the <b>Site Objets</b> pane select <b>Data Sources</b>, there your should have one data source for each List in the site.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>2. Duplicate List1 data source</b></div>
<div class="separator" style="clear: both; text-align: justify;">
Right click in your parent list data source, ours List 1, and click in <b>Copy and Modify</b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-2KhMNjvcml0/T4L87TbiWcI/AAAAAAAAAF0/1aEXzPTX3Os/s1600/duplicate_ds.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="254" src="http://1.bp.blogspot.com/-2KhMNjvcml0/T4L87TbiWcI/AAAAAAAAAF0/1aEXzPTX3Os/s320/duplicate_ds.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
In<b> General</b> tab give your data source a unique name and define in <b>Source</b> tab the filter you want. In our case "State Equals 'Active'", like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-BeUEKys0qOY/T4L9d7Nz6PI/AAAAAAAAAF8/ckjXlSFN6GA/s1600/datasource_config.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="237" src="http://1.bp.blogspot.com/-BeUEKys0qOY/T4L9d7Nz6PI/AAAAAAAAAF8/ckjXlSFN6GA/s320/datasource_config.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>3. Create new custom forms</b></div>
<div class="separator" style="clear: both; text-align: justify;">
In your child list, our List 2, create new custom forms, for New and Edit item. Repeat steps 4 to 6 for each form. Don't forget to make the new custom forms the default ones.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>4. Delete the Form Field of ColumnA</b></div>
<div class="separator" style="clear: both; text-align: justify;">
Edit your form and delete the Form Field associated to ColumnA</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>5. Insert a new data source</b></div>
<div class="separator" style="clear: both; text-align: justify;">
In the<b> Insert</b> tab, insert a new data source and pick the one you created in step 2.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-p9Zh5ZLBUOE/T4L-j1hQ4qI/AAAAAAAAAGE/Lv80WcTM-nw/s1600/insert_ds.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-p9Zh5ZLBUOE/T4L-j1hQ4qI/AAAAAAAAAGE/Lv80WcTM-nw/s1600/insert_ds.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b>6. Insert a Sharepoint Drop Down control</b></div>
<div class="separator" style="clear: both; text-align: justify;">
After inserting the data source, go again to <b>Insert</b> tab and insert a <b>Data View DropDownList</b> from Sharepoint controls.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-8kJH8X9ZOk4/T4L_CHIlnnI/AAAAAAAAAGM/gBluAQTAjGw/s1600/insert_dropdown.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-8kJH8X9ZOk4/T4L_CHIlnnI/AAAAAAAAAGM/gBluAQTAjGw/s320/insert_dropdown.jpg" width="317" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
Ok now that you added everything needed, you just need to configure the newly added field to map the fitlered data source. Pick the field and click <b>Data Fields ...</b> link</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-gCvVc62_Gow/T4L_cf5_RfI/AAAAAAAAAGU/1sTceZpzSw0/s1600/configure_dropdown.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="295" src="http://2.bp.blogspot.com/-gCvVc62_Gow/T4L_cf5_RfI/AAAAAAAAAGU/1sTceZpzSw0/s320/configure_dropdown.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
In data field, pick the lookup column.</div>
<div class="separator" style="clear: both; text-align: justify;">
In <b>data source</b>, pick the data source added in step 5</div>
<div class="separator" style="clear: both; text-align: justify;">
For the <b>display text</b>, pick the field you want to be displaied to the user</div>
<div class="separator" style="clear: both; text-align: justify;">
For the<b> field value</b>, pick the value passed to the lookup column, tipically ID field.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Ok save everything and go to your site. You should be getting something like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-EmOKdBO5gcI/T4MAKf2aKkI/AAAAAAAAAGc/RBIs7859YSE/s1600/list2_final.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="http://1.bp.blogspot.com/-EmOKdBO5gcI/T4MAKf2aKkI/AAAAAAAAAGc/RBIs7859YSE/s320/list2_final.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<u>ColumnA only shows items from List 1 which State field has the value Active.</u></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Hope you enjoyed it and if you want to see this working, download the following site template <a href="https://docs.google.com/open?id=0BzBaIn5fuGoscFljTW9FMlJRRS1KY1RJNXF4Z1p5Zw" target="_blank">Filter Lookup Site Template</a>. </div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
NOTE: This is an english template, if that is not your Sharepoint installation language you will need to install the English Language Pack, check it how in <a href="http://howididit-sharepoint.blogspot.com/2012/03/installing-sharepoint-foundation-2010_30.html" target="_blank">here</a>.</div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com26tag:blogger.com,1999:blog-2449128028642934343.post-66021344217705478592012-04-08T12:05:00.000+01:002013-01-30T19:39:12.803+00:00Datasheet View not workingThis will be one fast tip.<br />
<br />
Recently I was struggling with Datasheet View, in some clients it simply didn't show. So how I did it in 30 seconds?<br />
<br />
<a name='more'></a><br />
The icon was enabled, but kept receiving the following message:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-AWnrBK4kb1k/T4FvPlrt5eI/AAAAAAAAAFc/QPIqRgHEtaI/s1600/Datasheet+Error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="170" src="http://3.bp.blogspot.com/-AWnrBK4kb1k/T4FvPlrt5eI/AAAAAAAAAFc/QPIqRgHEtaI/s320/Datasheet+Error.png" width="320" /></a></div>
<br />
After digging a while I find out the problem. I was using Office 2010 x64 with IE x32.
<br />
That means the datasheet view components weren't installed correctly. I need the x86 version of the components. In my case, I couldn't install Microsoft Office Access database engine 2010 x86 version, as I have Office 2010 x64. So the option now is to have Microsoft Office Access database engine 2007 x86 instead.<br />
<br />
If that is your case follow the link<span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;"> </span><a href="http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734" style="background-color: white; color: #1155cc; font-family: arial, sans-serif; font-size: 13px;" target="_blank">http://www.microsoft.com/en-<wbr></wbr>us/download/confirmation.aspx?<wbr></wbr>id=23734</a> pick the version suited to your IE version, install it and bam it should work.<br />
<br />
I even tried this components in a computer without any Office application installed. Amazingly I also worked.<br />
<br />
<span style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify;">If you want to keep in touch, feel free to Subscribe to </span><a href="http://feedburner.google.com/fb/a/mailverify?uri=HowIDidIt-SharepointFoundation2010&amp;loc=en_US" style="background-color: white; color: #6699cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: justify; text-decoration: initial;" target="_blank">How I did it - Sharepoint Foundation 2010</a>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com2tag:blogger.com,1999:blog-2449128028642934343.post-78690175771197010462012-04-05T20:39:00.000+01:002012-04-05T20:39:08.079+01:00Sharepoint 2010 and Cascade Lookups<div style="text-align: justify;">
Here I am for another great tip. One of the things that lack in Sharepoint 2010 is the ability to create Cascade Lookup columns. This is, to filter the options of a lookup column based on the value of another.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Around the web you can find many solutions, I used one hosted in Codeplex <a href="http://spcd.codeplex.com/">http://spcd.codeplex.com</a>. The documentation needs some tweak, here you might see how I managed to put it to work.</div>
<div style="text-align: justify;">
Also, it has a little problem with Chrome, that I solved.</div>
<div style="text-align: justify;">
<br /></div>
<a name='more'></a><div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><span style="font-size: large;">The problem</span></b></div>
<div style="text-align: justify;">
Supose the following, you have 3 lists.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>List1 > Column1</u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-VSfC-uYsVjA/T3rKxWpcEWI/AAAAAAAAAEo/dm-eLEnJsDg/s1600/list1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-VSfC-uYsVjA/T3rKxWpcEWI/AAAAAAAAAEo/dm-eLEnJsDg/s1600/list1.jpg" /></a></div>
<div style="text-align: justify;">
<u><br />
</u></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>List2 > Column2 and Column3</u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-_NY36cb1xD8/T3rMHaReujI/AAAAAAAAAFA/sLE4BNYhm9A/s1600/list2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-_NY36cb1xD8/T3rMHaReujI/AAAAAAAAAFA/sLE4BNYhm9A/s1600/list2.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<i>Column3 is a lookup connected to Column1 in List1</i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>List3 > Column4, Column5 and Column6</u></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-G4hATLwKkKU/T3rMQEJxy_I/AAAAAAAAAFI/IDo5Q263o-U/s1600/list3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="77" src="http://3.bp.blogspot.com/-G4hATLwKkKU/T3rMQEJxy_I/AAAAAAAAAFI/IDo5Q263o-U/s320/list3.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<u><br />
</u></div>
<div style="text-align: justify;">
<i>Column4 is a lookup connected to Column1 in List1</i></div>
<div style="text-align: justify;">
<i>Column5 is a lookup connected to Column2 in List2</i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now the goal is to filter the options of the lookup field Column5 based on the value of Column4.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><span style="font-size: large;">The solution</span></b></div>
<div style="text-align: justify;">
<b>1. Download spcd.js </b></div>
<div style="text-align: justify;">
There is a version of spcd.js in Codeplex, but that version does not work in Google Chrome. I have created a new version which can be downloaded frm <a href="https://docs.google.com/open?id=0BzBaIn5fuGosbkIzSjNITEFSci1ZYVZadEtDUEN4QQ" target="_blank">here</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>2. Upload spcd.js to your Sharepoint site</b></div>
<div style="text-align: justify;">
Now that you have spcd.js script, just upload it into your Sharepoint site. You can upload it to a Library or use Sharepoint Desinger to upload it into a Folder. Up to you, pick the one you like more.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>3. Create the lists in Sharepoint</b></div>
<div style="text-align: justify;">
If you have not created the lists, now it is the time. Create the lists and connect them with Lookup columns.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>4. Create a new item custom form and make it default form</b></div>
<div style="text-align: justify;">
Use Sharepoint Desinger to create a new custom form, in your list with the two fields (mine List3). <u>Don't forget to mark it as the Default one</u>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>5. Add a Content Editor web part to the new form</b></div>
<div style="text-align: justify;">
Now, edit the newly created form and add a Content Editor web part <u>after the form webpart</u> (the script will not work if you place the Content Editor before the form webpart)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>6. Configure the Content Editor web part</b></div>
<div style="text-align: justify;">
Last, edit the Content Editor web part in HTML and add the following code to it:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;"><script src="<script_location/spcd.js" type="text/javascript"></script></span></div>
</div>
<div style="text-align: justify;">
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;"><script type="text/javascript"></span></div>
</div>
<div style="text-align: justify;">
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;">var ccd1 = new cascadeDropdowns("Column4", "Column5", "Column3", "List2", "Column2");</span></div>
</div>
<div style="text-align: justify;">
<div style="text-align: left;">
<span style="font-family: 'Courier New', Courier, monospace;"></script></span></div>
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><br />
</span></div>
<div style="text-align: justify;">
where:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>script_location</u>: is the folder or library path where your uploaded <b>spcd.js</b>. Use relative path, if you place the full http:/server/library/scd.js, the script will not work.</div>
<div style="text-align: justify;">
<u>Column4</u>: Is the<b> display name</b> of the Parent column in List3</div>
<div style="text-align: justify;">
<u>Column5</u>: Is the<b> display name</b> of the Child column in List3</div>
<div style="text-align: justify;">
<u>Column3</u>: Is the<b> internal name</b> of the column in List2 linked to List1</div>
<div style="text-align: justify;">
<u>List2</u>: Is the<b> display name</b> of List2</div>
<div style="text-align: justify;">
<u>Column2</u>: Is the<b> internal name</b> of the column in List2 that feed the Child column (Column5)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>PS: When creating column, avoid special characters in the name, as the internal name will be a mess because of it. It will work, but the column is a bit more ugly.</u></div>
<div style="text-align: justify;">
<u><br />
</u></div>
<div style="text-align: justify;">
<b>7. Try it!!</b></div>
<div style="text-align: justify;">
Ok, now that you put it all together just try to add a new item into List3. You should be getting something like this:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-6iVbKxrl-Y4/T3rXNxVV40I/AAAAAAAAAFQ/h-7tS7Nh7pQ/s1600/tryit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://3.bp.blogspot.com/-6iVbKxrl-Y4/T3rXNxVV40I/AAAAAAAAAFQ/h-7tS7Nh7pQ/s400/tryit.jpg" width="340" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
If not, well e-mail me <a href="mailto:ped%72o.%72%6Fsa%65%40gma%69%6C.%63o%6D">pedro.rosae@gmail.com</a>, I will help you out.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Want a shorcut, download a site template fully configured <a href="https://docs.google.com/open?id=0BzBaIn5fuGosR1ZrdEZQNUlSVXlUVW10ZnFpbUk4QQ" target="_blank">here</a>. The language of this template is English, so if you are using a non-english Sharepoint installation don't forget to install the English Language Pack, check how to do it at <a href="http://howididit-sharepoint.blogspot.pt/2012/03/installing-sharepoint-foundation-2010_30.html" target="_blank">Installing Sharepoint Foundation 2010 Language Pack - Windows 7</a>.</div>
<div style="text-align: justify;">
<br /></div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com11tag:blogger.com,1999:blog-2449128028642934343.post-6404408078977494512012-03-30T23:45:00.003+01:002012-03-30T23:46:40.760+01:00Installing Sharepoint Foundation 2010 Language Pack - Windows 7Ok now that you have a <a href="http://howididit-sharepoint.blogspot.pt/2012/03/installing-sharepoint-foundation-2010.html#more" target="_blank">Sharepoint Development Environment installed in Windows 7</a>, in order to create localized content you will also need Sharepoint Language Pack. Again, installing it in Windows 7 (at least Professional edition) isn't straightforward.<br />
<br />
So how i dit it in 4 easy steps:<br />
<br />
<a name='more'></a><br />
<b>1. Download Sharepoint Foundation 2010 Language Pack</b><br />
<ul>
<li><a href="http://www.microsoft.com/download/en/details.aspx?id=4731" target="_blank">Microsoft Sharepoint Fondation 2010 Language Pack</a></li>
</ul>
Download only the language you need and note, no need to download the language pack used in the Sharepoint Foundation 2010 installation.<br />
<br />
<strong>2. Extract Microsoft Sharepoint Foundation 2010 Language Pack installer</strong><br />
<div>
You will need to change some files inside the installer package, if you try to run it as is, you will receive and error with a message that operating system is not supported.</div>
<div>
</div>
<div>
So execute the following command in the installer folder:<br />
<em>SharePointLanguagePack.exe /extract:c:\SharePointLanguageFiles</em></div>
<div>
<i><br /></i></div>
<div>
This will extract all the files into c:\SharePointLanguageFiles<br />
<br />
<strong>3. Edit config.xml</strong><br />
<div>
Ok, last but not least, edit in your favorite text file editor the<i> c:\SharePointFiles\files\Setup\config.xml</i> and add the line <br />
<br />
<i><Setting Id="AllowWindowsClientInstall" Value="True"/></i> <br />
<br />
just before <br />
<br />
<i></Configuration></i>. <br />
<br />
<strong>4. TWEAK DONE!! Install Microsoft Sharepoint Foundation 2010 Language Pack</strong></div>
</div>
Just run the file<i> c:\SharePointLanguageFiles\Setup.exe</i> and follow the steps. Also don't forget to rerun SharePoint 2010 Products Configuration Wizard.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-rHbE8myYHCA/T3Y2dbTsgMI/AAAAAAAAAEc/hmC_MCOYQSE/s1600/SharePoint+2010+Products+Configuration+Wizard.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="275" src="http://2.bp.blogspot.com/-rHbE8myYHCA/T3Y2dbTsgMI/AAAAAAAAAEc/hmC_MCOYQSE/s320/SharePoint+2010+Products+Configuration+Wizard.jpg" width="320" /></a></div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com1tag:blogger.com,1999:blog-2449128028642934343.post-29520842497519076672012-03-23T10:24:00.001+00:002012-03-30T23:30:00.912+01:00Installing Sharepoint Foundation 2010 - Windows 7One of the great things of Microsoft Sharepoint Foundation 2010 is the capability of creating a development environment in Microsoft Windows 7 Professional (does not work in Windows 7 Home editions). This become pretty handy for me, my working computer is a laptop, so I can now develop applications anywhere without restrictions.<br />
<br />
So how I did it in 6 easy steps?<br />
<br />
<a name='more'></a><br />
<br />
<b>1. Download Sharepoint Foundation 2010 and all the required software</b><br />
<ul>
<li><a href="http://go.microsoft.com/fwlink/?LinkID=141237" target="_blank">Microsoft Sync Framework</a></li>
<li><a href="http://support.microsoft.com/kb/974405" target="_blank">Windows Identity Foundation (Windows6.1-KB974405-x64.msu)</a></li>
<li><a href="http://go.microsoft.com/fwlink/?LinkId=123718" target="_blank">SQL Server Native Client</a></li>
<li><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=25052" target="_blank">Microsoft SQL Server 2008 R2 RTM - Express with Management Tools</a> </li>
<li><a href="http://www.microsoft.com/download/en/details.aspx?id=5970" target="_blank">Microsoft Sharepoint Foundation 2010</a></li>
</ul>
<div>
<br /></div>
<div>
<b>2. Configure IIS web server in Windows 7</b></div>
<div>
Copy and paste the following script in a command line.</div>
<div>
<pre style="font-family: Consolas, Courier, monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; padding: 5px; text-align: left; word-break: break-all; word-wrap: break-word;">start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;^
IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;^
IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;^
IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;^
IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;^
IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;^
IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;^
IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;^
IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;^
WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;^
WCF-NonHTTP-Activation</pre>
</div>
<div>
</div>
<div>
<b>3. Extract Microsoft Sharepoint Foundation 2010 installer</b></div>
<div>
You will need to change some files inside the installer package, if you try to run it as is, you will receive and error with a message that operating system is not supported.</div>
<div>
<br /></div>
<div>
So execute the following command in the installer folder:<br />
<i>SharePointFoundation.exe /extract:c:\SharePointFiles</i></div>
<div>
<i><br /></i></div>
<div>
This will extract all the files into c:\SharePointFiles</div>
<div>
<br /></div>
<div>
<b>4. Install Microsoft FilterPack 2.0</b></div>
<div>
In the files extracted in step 3 install:<br />
<i>c:\SharePointFiles\PrerequisiteInstallerFiles\FilterPack\FilterPack.msi</i></div>
<div>
<i><br /></i></div>
<div>
<b>5. Edit config.xml</b></div>
<div>
Ok, last but not least, edit in your favorite text file editor the<i> c:\SharePointFiles\files\Setup\config.xml</i> and add the line <br />
<br />
<i><Setting Id="AllowWindowsClientInstall" Value="True"/></i> <br />
<br />
just before <br />
<br />
<i></Configuration></i>. </div>
<div>
<br /></div>
<div>
<div>
<b>6. FINALLY!! Install Microsoft Sharepoint Foundation 2010</b></div>
<div>
Just run the file<i> c:\SharePointFiles\Setup.exe</i> and follow the steps.</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-TR-3goAdIPM/T2xUsVe7WFI/AAAAAAAAACI/6JposuUePOE/s1600/sharepoint_install.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="259" src="http://1.bp.blogspot.com/-TR-3goAdIPM/T2xUsVe7WFI/AAAAAAAAACI/6JposuUePOE/s320/sharepoint_install.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Ok, you now have a small Sharepoint installation that should be used for development, but it can serve up to 10 clients, with a 10GB database. Enjoy.</div>Anonymoushttp://www.blogger.com/profile/12644018449589566949noreply@blogger.com0