【发布时间】:2019-06-18 14:30:06
【问题描述】:
我正在与一位客户合作,并试图做到这一点,以便在按下按钮打开新的会计年度 (FY) 表单时,它还会将该 FY 值添加为文档库列中的选择选项。我也在尝试将默认值设置为该新值。
这是我当前的代码。这只是一个配置问题吗?还是我在用我的代码做一些事情?
Imports Microsoft.SharePoint
...
Partial Class _Default
Inherits System.Web.UI.Page
...
Protected Sub SaveNew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveNew.Click
...
'Added 6/12/2019 - Testing new FY options in Document Upload Form
Using site As New SPSite("http://sptest/spsite/default.aspx")
Using web As SPWeb = site.OpenWeb()
Dim leadLst As SPList = web.Lists("Document Library")
Dim col As SPFieldChoice = CType(leadLst.Fields("Fiscal Year"), SPFieldChoice)
col.Choices.Add(FY.Text)
col.DefaultValue = FY.Text
col.update()
leadLst.update()
End Using
End Using
'End Added 6/12/2019
...
End Sub
【问题讨论】:
标签: vb.net sharepoint sharepoint-2010