在SharePoint2007下测试通过。

使用SharePoint对象模型:

SPFieldCollection collFields = list.Fields;
//Update the calculated column
if (collFields.ContainsField("Document ID"))
{
    collFields["Document ID"].Update();
}

 

使用Powershell:

[System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”)
#This will get the site URL
$siteUrl= http://Site URL
#This is to get the WebApp
$webName = "WebAppName"
$spSite = new-object Microsoft.SharePoint.SPSite($siteurl)
$spWeb = $spSite.OpenWeb()
Write-Host $spList = $spWeb.Lists["ListName"]
Write-Host {list found}
$collFields = $spList.Fields[""];
$collFields.Formula= "=[Field1]+[Field1No]+[Field45No]"
$collFields.update();

 

相关文章:

  • 2021-05-20
  • 2022-02-23
  • 2021-07-29
  • 2021-12-27
  • 2021-11-13
  • 2021-06-12
  • 2021-06-24
  • 2021-06-21
猜你喜欢
  • 2021-10-25
  • 2021-11-02
  • 2021-10-13
  • 2021-09-30
  • 2021-12-23
  • 2021-07-30
  • 2021-12-18
相关资源
相似解决方案