按字段设置属性Promotion Demotion [英] Set property Promotion Demotion by field
问题描述
是否有指定文档库中的某些字段不参与属性提升降级?我正在开发自定义事件接收器,我不希望某个受系统保护的字段由上传的.docx文件中的值包含。
Are there anyway to specify that certain fields in document library do not participate in property promotion demotion? I am developing custom event receivers and I do not want certain system protected fields to be set by value contains in .docx file uploaded.
推荐答案
嗨GuYuming,
Hi GuYuming,
如果要在上传文档后使某些字段未设置值,可以在事件接收器中添加ItemAdded事件接收器,使用SPListeItem对象覆盖项值为空,例如,使系统标题字段没有设置值,将
留空:
If you want to make some field not set value after uploading the document, you could add a ItemAdded Event Receiver, in the Event Receiver, use SPListeItem Object to Override the item value to empty, for example make system Title field not set value, leave it empty:
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
properties.ListItem["Title"] = "";
}
谢谢
最好的问候
这篇关于按字段设置属性Promotion Demotion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!