Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SetViewXml not working

$
0
0

I'm trying to use GetViewXml with SetViewXml. To change a 2 to a 1. So. You can already see the difficulty.

This is what I came up with. Can anyone tell me why it doesn't do anything, like throw an error?

$allView = $list.Views["All Documents"]
$allView.SetViewXml( $allView.GetViewXml().Replace("BaseViewID=""2""", "BaseViewID=""1""") )
$allView.Update()

 

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>