سؤال

In a list with two content types - both with the same field "Title", I need to make the field readonly in one of the content types, but not the other (in one the title is manually set, in the other the title is set by code).

Is this possible?

هل كانت مفيدة؟

المحلول

You can do this in PowerShell as follows:

$fieldLink = $list.ContentTypes["YourCT"].FieldLinks | where {$_.Name -eq "YourField"}
$fieldLink.ReadOnly = $true
$list.ContentTypes["YourCT"].Update()
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top