讨论板 - 更改IsQuestion字段的默认值 [英] Discussion Board - Change the Default value of IsQuestion Field

查看:57
本文介绍了讨论板 - 更改IsQuestion字段的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在讨论区中,默认情况下为"IsQuestion"。复选框未选中。并且无法从前端更改该默认值。


由于它是密封列,我们尝试使用powershell更改该列的密封属性。


以下是更改密封属性的脚本


$ web = Get-SPWeb(" sitecollurl")


$ list = $ web.Lists [" listname"]


$ contenttype = $ list.ContentTypes [" Discussion"]

$ column = $ contenttype.Fields.GetFieldByInternalName(" IsQuestion")

$ column.Sealed = $ true


在此声明之后我们得到了以下错误


异常设置"密封":"由于对象的当前状态,操作无效。


请帮助我在这个






感谢你,Nagendra。

解决方案

您好


转到讨论列表设置,向下滚动到列。单击"问题",将默认值更改为"是"。



Hi,

In Discussion board, by default "IsQuestion" checkbox is unchecked. And there is no scope to change that default value from front end.

As it is a sealed column, we have tried to change the sealed property of that column with powershell.

Below is the script for changing the sealed property

$web = Get-SPWeb ("sitecollurl")

$list = $web.Lists["listname"]

$contenttype=$list.ContentTypes["Discussion"]
$column=$contenttype.Fields.GetFieldByInternalName("IsQuestion")
$column.Sealed=$true

After this statement we are getting the below error

Exception setting "Sealed": "Operation is not valid due to the current state of the object.

Please help me on this


Thanking You, Nagendra.

解决方案

Hi

Go to discussion list settings, scroll down to Columns. Click Question, change the default value to Yes.


这篇关于讨论板 - 更改IsQuestion字段的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆