Browse by Tags

Sorry, but there are no more tags available to filter with.
Modifying a web part’s unnamed view with POSH
06 November 09 06:52 PM | Blogging about SharePoint: Posts
Body: Here’s a little POSH script I wrote today, generalized a bit. The web part in question shows a list that has a column named “Title”, and one named “Percentage”, where it grouped them by a column called MarketType. It started out sorting ascending by title, and afterwards sorts descending by percentage. function global:Sort-WPBiggestPercentOnTop($SPViewUsedByWP) { $oldqu = $SPViewUsedByWP.Query if $oldqu -ne "<GroupBy Collapse=""FALSE"" GroupLimit=""100""><FieldRef Name=""Market_x0020_Type"" Ascending=""FALSE"" /></GroupBy><OrderBy><FieldRef Name=""Title"" /></OrderBy>" { write-error "View not as expected"} $newqu = $oldqu.Replace("<FieldRef Name=""Title"" />","<FieldRef Name=""Percentage"" Ascending=""FALSE"" />" $SPViewUsedByWP.Query = $newqu $SPViewUsedByWP.Update() write-host "Need to reset the state of the web part toolbar, it gets changed when the view gets edited." } Category: PowerShell and SharePoint Published: 11/6/2009 3:52 PM Del.icio.us | Digg It | Technorati ...
PSBB mentioned on SharePoint PodShow episode 13
02 March 09 07:11 PM | Blogging about SharePoint: Posts
Body: If you haven't started listening to the SharePoint Pod Show, you should! It's at www.sharepointpodshow.com , and I've listened two a few episodes so far - in particular the interviews with Andrew Connell and Jeremy Thake ( Episode 13 ). Thake even mentions my PowerShell Building Blocks (PSBB's) for SharePoint at 40 minutes, 53s to 42 minutes 45 seconds. PSBB is one of my CodePlex projects - you can find it at www.codeplex.com/PSBB . He mentions one that displays the SharePoint version number. I don't think that's actually in the PSBB collection - yet. I need to add a number of scripts to it, and work with Neil Iverson to include his. I the mean time, here is how to get the SharePoint version number. function global:Get-SPFarm{ return [Microsoft.SharePoint.Administration.SPFarm]::Local } $farm = Get-SPFarm $farm.BuildVersion The result is: Major Minor Build Revision ----- ----- ----- -------- 12 0 0 6318 --- Michael Category: PowerShell and SharePoint Published: 3/2/2009 4:11 PM Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Bits and Bytes
29 January 09 03:28 PM | Blogging about SharePoint: Posts
Body: Here's a bunch of brief things that I think are too short to merit their own post. 1) CAML syntax that ought to error but doesn't. Double, Nested Query tags return all records. Strange thing. When building a CAML query, I accidentally malformed my query syntax: Instead of <Query><Where><and> etc, I had <Query><Query><Where><And> etc.. I had an extra pair of Query tags within the outer Query tags. I would expect that to be invalid (not conforming to the CAML Query Schema for example) but it's not. Instead of throwing a error, it treats the where clause like it's not there and returns all records. 2) Anonymous Access permissions can't be set of you have the list's Advanced Settings set so users can only read their own items. This makes sense, but the connection between the disabled checkboxes on the anonymous access permissions page and the Advanced Settings is not obvious. I discovered this when I needed to allow anonymous users to be able to add items to a list (such as contact requests for a user group). To do this, you have to give anonymous users the Add items and View items permissions (you can't give Add without View). 3) There is a BDC behavior when refreshing...