Posts

Showing posts from June, 2012

Sharepoint 2010 - Multilanguage Site - Show column in current language

Image
In multilanguage site feature, Sharepoint 2010 does not translate content of web part and metadata. We have to find a way to show to user content or metadata in current language. I used a list with columns with content in language and a lot of jquery to show and hide columns for current language. I have a list with "DescriptionIT" and "DescriptionEN" columns. Then, I set a view with both columns visible. In this view, I added a content query web part whit code below. In this code, I search for current language, i.e. "Italian", then search for column with "DescriptionIT", and hide all columns but "DescriptionIT" (with name starting with "Decsription"). Result is that if I change language (with Select Display Language), I see only column in respective language. Simple and cross platform. Here the code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type=&quo

Sharepoint 2010: BeforeProperties and AfterProperties in Event Receivers!

Event Receiver is a great feature for Sharepoint 2010, but I spent many time to discover how Properties works.. Especially BeforeProperties and AfterProperties.. I found a great post with resume all available values. Here table and below the link! http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=122 These are the values of the properties in  List  events: List BeforeProperties AfterProperties properties.ListItem ItemAdding No Value New Value Null ItemAdded No Value New Value New Value ItemUpdating No Value Changed Value Original Value ItemUpdated No Value Changed Value Changed Value ItemDeleting No Value No Value Original Value ItemDeleted No Value No Value Null And here are the properties available in  Library  events: Library BeforeProperties AfterProperties properties.ListItem ItemAdding No Value No Value Null ItemAdded No Value No Value New Value ItemUpdating Original Value Changed Value Original Value ItemUpdated Original Value Changed Value Cha

Sharepoint 2010: Deactivate and Activate Feature with Power Shell

Sometimes, you can have trouble with feature upgrade in your site. Especially if you upgrade event receiver, adding new trigger. If you have many sub site using this feature, you can use Power Shell to deactivate and activate feature. This mine: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $rootUrl = "http://[SERVERNAME]" $site = Get-SPSite $rootUrl foreach($web in $site.AllWebs) {   $url = $web.Url   if($url -ne $rootUrl){    foreach($feature in Get-SPFeature -Web $url)    {     $featureName = $feature.DisplayName     if($featureName -eq "FEATURE NAME")     {       "Disable and Enable feature $featureName in $web"       Disable-SPFeature -Identity FEATURENAME -Url $url -Confirm:$false       Enable-SPFeature -Identity  FEATURENAME -Url $url       break;     }    }   } }

Sharepoint 2010 Globally Reusable Workflows does not update WF instance in Subsite if re-published: PS Script save me

I defined a Globally Reusable WF for a custom Content Type in root site, with a custom form with InfoPath. I defined a sub site with a list using the global WF template created for its Content Type. Everything works without problems. Now I need to change the WF (both in form and in the process). BUT.. If I edit only the form with InfoPath and then I publish the form, I see correctly the new form in WF on subsites. If I change the WF logic too (any actions) and publish WF (in root site), changes are not perceived by WF on subsites. WF on subsite is updated only if, on subsite, I open WF to change (from browser) and save it. I expect that you can update all WF in subsite using template in root site, without having to reopen and resave each WF in each subsite. I don't understand if it's a bad configuration or a issue on Globally Reusable WF. (I opened question in Technet Forum, here ) UPDATE: Sometimes, I update a WF (form and logic) and logic has been correctly pub