Hello everybody.
I am creating a whole structute of spaces with PowerShell.
When I create a new view with powershell I use this code.
$viewFields = New-Object System.Collections.Specialized.StringCollection
$viewFields.Add("Type")
$viewFields.Add("Name")
$viewFields.Add("Modified")
$viewFields.Add("Modified By")
$query = "<OrderBy><FieldRef Name='Last Updated' Ascending='false' /></OrderBy>"
$view = $list.Views.Add("WebPartView", $viewFields, $query, 3, $false, $false)
$view.TabularView = $false
$view.Update()Which is correct and working fine.
The question is about the Sort opcion. When I apply the sorting through the query, it is being stored there. I can check the item on PowerShell and the query is stored in the $view.Query property.
And after that, when I go to edit the view, there is no sorting applied (it is somehow inside the view, on the query level) so if someday I would like to change that sorting, it would not be possible.
How can I apply the sorting option with powershell, using the normal system (the one that later could be modified by editing the view) and not the query style?
Thanks all.