Вопрос

I try to change an SPField after SPList creation, but I'm not getting any results of that change. using this code:

    SPField oSPField = oSPList.Fields[new Guid("MyFieldGuid")];
    oSPField.ReadOnlyField = true;
    oSPField.ShowInEditForm = false;
    oSPField.ShowInNewForm = false;
    oSPField.Update();

and then...nothing happens. What's wrong?is there any change to change it without coding?

(the field CT is provided by an ContentType Hub.)

Это было полезно?

Решение

Since you are effectively changing the list schema, you may have to do an oSPList.Update() as well.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top