Created
March 24, 2019 10:57
-
-
Save OlafD/a507b45982a1d27a01b62634590c3622 to your computer and use it in GitHub Desktop.
Move the field to the position behind another field in a content type. This script makes use of two other script files stored as gists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MoveFieldBehind | |
{ | |
param ( | |
[string]$ContentTypeName, | |
[string]$FieldToMove, | |
[string]$AnchorField | |
) | |
Write-Host "Put field $FieldToMove behind $AnchorField in Content Type $ContentTypeName" | |
$pos = . ..\Common\GetFieldPositionInContentType.ps1 -ContentTypeName $ContentTypeName -FieldName $AnchorField | |
$pos++ | |
. ..\Common\ReorderContentTypeFields.ps1 -ContentType $ContentTypeName -FieldName $FieldToMove -Mode Position -NewPosition $pos | |
} | |
MoveFieldBehind -ContentTypeName "Company Data" -FieldToMove "CompanyPrimary" -AnchorField "SharingCompany3" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment