I am working on a site collection inside sharepoint online office 365. and i want to create a site column with the following properties:-
show the site column in the display form. while hide it inside the create and edit forms.
link the site column with a jslink file.
now when i work on sharepoint on-premises, i do the first point by writing the following power shell script:-
$site = Get-SPSite -Identity "http://********/"
$web = $site.RootWeb
#Assign fieldXML variable with XML string for site column
$fieldXML = '<Field Type="Text"
Name="ItemNumber"
Description="auto generated item number.."
DisplayName="Item Number"
StaticName="ItemNumber"
Group="Custom Columns"
Hidden="FALSE"
Required="FALSE"
Sealed="FALSE"
ShowInDisplayForm="TRUE"
ShowInEditForm="FALSE"
ShowInListSettings="TRUE"
ShowInNewForm="FALSE"></Field>'
#Output XML to console
write-host $fieldXML
#Create site column from XML string
$web.Fields.AddFieldAsXml($fieldXML)
and for the second point by writing the following powershell script:-
$web = Get-SPWeb http://*****/
$field = $web.Fields["Item Number"]
$field.JSLink = "~siteCollection/Style Library/JS/HideItemNumberInQuickEdit.js"
$field.update($true)
but now inside office 365 i can not run powershell scripts. so can anyone adivce how i can achieve the above 2 points inside office 365 sharepoint online? can i run for example remote power-shell scripts? or can i use site apis to create site columns? or any other appraoch ?