PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Get-PnPField and Add-PnPFieldToContentType leads to: "It may have been deleted by another user" when creating a content type in a sub web

Open dbpprt opened this issue 9 years ago • 3 comments

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

dbpprt avatar Jul 10 '17 12:07 dbpprt

Any update on this? I'm facing the same issue. Not sure why it wasn't fixed.

Akhoy avatar Dec 26 '17 12:12 Akhoy

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?

JohnGrenfell avatar Jun 28 '18 11:06 JohnGrenfell

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

Lucho1970 avatar Sep 05 '19 19:09 Lucho1970