I have sharepoint farm 2013 on-premises. i wrote the following powershell script to export all the site columns properties which are inside the "Custom columns" group. now i wanted to document the following 3 properties for our current site columns ShowInEditForm
, ShowInNewForm
and ShowInDisplayForm
:-
#Get the Source Web
$sourceWeb = Get-SPWeb "http://*****/"
#Create a XML File to Export Fields
$xmlFile = "C:\SiteColumns.xml"
New-Item $xmlFile -type file -force
#Wrap Field Schema XML inside <Fields> Element
Add-Content $xmlFile "`n<Fields>"
#Export All Site Columns of specific Group to XML file
$sourceWeb.Fields | ForEach-Object {
if ($_.Group -eq "Custom Columns") {
Add-Content $xmlFile $_.SchemaXml
}
}
#Closing Wrapper
Add-Content $xmlFile "</Fields>"
#Dispose the web object
$sourceWeb.Dispose()
now i got the xml file generated for all the related columns, but when i checked the xml file to get the properties for the site columns, i can not view all the properties. here are two cases:-
1- I have a site column named InternalStatus
, and its xml will be as follow inside the generated .xml
file:-
<Field Type="Choice" DisplayName="InternalStatus" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" Format="Dropdown" FillInChoice="FALSE" Group="Custom Columns" ID="{26c00b45-ddd2-48aa-bac7-084fedc498ea}" SourceID="{35d8bcad-3ac7-4fda-9fe9-853460a8ac3a}" StaticName="InternalStatus" Name="InternalStatus" ShowInNewForm="TRUE" Version="3" ShowInDisplayForm="FALSE"><Default>Stage1</Default>
<CHOICES>
<CHOICE>Stage1</CHOICE>
<CHOICE>Stage2</CHOICE>
<CHOICE>Stage3</CHOICE>
<CHOICE>Stage4</CHOICE>
<CHOICE>Stage5</CHOICE>
</CHOICES>
</Field>
So seems at-least this property is missing ShowInEditForm
. Now as shown in the above xml the ShowInNewForm
and ShowInDisplayForm
properties are there , but i am not sure why the showInEditForm
is missing ?
2- I have another site column named AssignedToHidden
, and its xml will be as follow inside the generated .xml
file:-
<Field Type="UserMulti" DisplayName="AssignedToHidden" List="UserInfo" Required="FALSE" EnforceUniqueValues="FALSE" ShowField="ImnName" UserSelectionMode="PeopleAndGroups" UserSelectionScope="0" Group="Custom Columns" ID="{97e1ca20-1b16-40bd-9f89-6a1283374937}" SourceID="{35d8bcad-3ac7-4fda-9fe9-853460a8ac3a}" StaticName="AssignedToHidden" Name="AssignedToHidden" Mult="TRUE" Sortable="FALSE" Version="1
"/>
now for this site column these 3 properties are missing ShowInEditForm
, ShowInNewForm
and ShowInDisplayForm
.. so i am not sure why..
so can anyone adivce what is the problem inside the site columns and/or inside the above power-shell script, that some site columns are missing some properties inside the generated xml
file??