Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Modifying ShowInNewForm & ShowInEditForm properties of a site column

$
0
0

I want to hide a site column from the New & Edit forms , inside all the lists and sub sites, so i try the following Script:-

 #Get site and web object
    $site = Get-SPSite -Identity "http://servername"
    $web = $site.RootWeb


    $dtField = $web.Fields["Item Number"]
    $dtField.ShowInEditForm="False"

    $dtField.ShowInNewForm="False"
    $dtField.Update($true)

    #Dispose of Web and Site objects
    $web.Dispose()
    $site.Dispose() 

now the script did not raise any error , but the fields are still being displayed inside the New & Edi forms? can anyone adivce on this please ?


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>