开发者

Setting ForceCheckout on an SPList

开发者 https://www.devze.com 2022-12-26 13:34 出处:网络
I\'m trying to set the ForceCheckout property on an SPList item and it\'s just not taking.I\'m calling the Update() command as required.All it should take, in essence, is the following two lines.

I'm trying to set the ForceCheckout property on an SPList item and it's just not taking. I'm calling the Update() command as required. All it should take, in essence, is the following two lines.

$myList.ForceCheckout = $false
$myLis开发者_高级运维t.Update()

Any ideas why this isn't working? It's remains $true no matter what.


Are you really using $myList, or are you doing something like:

$web.lists["foo"].forcecheckout = $false
$web.lists["foo"].update()

...because the above won't work. Each time you use the Lists collection with an indexer like this, you're getting a new instance of the list. The second line doesn't know about the first line's changes. Ensure you do:

$myList = $web.Lists["foo"]
$myList.forcecheckout = $false
$myList.update()

This will work because you're using the same instance.

-Oisin

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号