Get-PnPField and Add-PnPFieldToContentType leads to: "It may have been deleted by another user" when creating a content type in a sub web
Reporting an Issue or Missing Feature
I'm trying to get a base column "URL" with Get-PnPField from a Subsite and add it to a content type which is created in a subsite.
Expected behavior
It should find the base column as its inherited from the root web.
Actual behavior
Column 'URL' does not exist. It may have been deleted by another user.
Steps to reproduce behavior
Connect-PnPOnline -Url "https://xxx.sharepoint.com/sites/sitecollection/justasubsite $field = Get-PnPField -Identity "URL" <= Exception...
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [x] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
Major Minor Build Revision
2 16 1706 1
How did you install the PnP-PowerShell Cmdlets?
- [x] MSI Installed downloaded from GitHub
- [ ] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Any update on this? I'm facing the same issue. Not sure why it wasn't fixed.
I have the same issue. Scripting the creation of 30 sub web's which require the usage of site fields with Add-PnPFieldToContentType - the field is in the hierarchy and have found this limitation. Any idea on a workaround/update on the issue?
It is now Sep. 2019 and I am still having the same issue. I was hoping to create all my site columns and content types at the root level and then add them to lists on the sub sites, but I get : Add-PnPContentTypeToList : Cannot bind argument to parameter 'ContentType' because it is null. I can do it from the UI, so it must be possible. Is there another way? Using the 2013 version