How could I disable a managed metadata field?. I'm pulling the information of that field from another List and I don't want the user to modify its value
-
Can you explain a bit more? You mean you want user to only read data from the list?– Amal HashimApr 16, 2015 at 21:42
-
I don't want the user modify the values I'm setting in that field– yngrdynApr 17, 2015 at 1:43
-
Can't you disable the field by making it read only?– Amal HashimApr 17, 2015 at 1:44
-
No i can't. Because it's a Managed Metadata field. So i don't know well what do i have to make read only, there certains divs and things that Sharepoint creates to managed this kind of field– yngrdynApr 17, 2015 at 3:28
Add a comment
|
2 Answers
You can make the MMD field hidden, through PowerShell
function Get-TermSet([string]$groupName, [string]$termSetName)
{
$termStore = Get-TermStoreDefault
return $termStore.Groups[$groupName].TermSets[$termSetName]
}
$termSet = Get-TermSet $yourtermStorGroupName $yourtermSetName
$taxoField = $yourweb.Fields.CreateNewField("TaxonomyFieldType",
$displayName)
taxoField.SspId = $termSet.TermStore.Id
taxoField.TermSetId = $termSet.Id
taxofield.AllowMultipleValues = $false
taxofield.Group = $fieldGroup
taxofield.StaticName = $staticName
taxofield.ShowInEditForm = $false #here is the solution
taxofield.ShowInNewForm = $false #here is the solution
taxofield.Hidden = $true #here is the solution
taxofield.Required = $false
$web.Fields.Add($taxofield);
$web.Update();