0

I am deploying two new site column and try to attach them to a existing site content type with

<ApplyElementManifests>
  <ElementManifest Location="5b1d5abd-297f-41e2-88d4-3c2fc9c23962\elements-v2.xml" />
</ApplyElementManifests>
<AddContentTypeField ContentTypeId="0x0100964BEED5C19240C5A561F41A2C0A6A20" FieldId="{7900be76-ca1a-4563-9b4c-f738805a401b}" PushDown="TRUE" />
<AddContentTypeField ContentTypeId="0x0100964BEED5C19240C5A561F41A2C0A6A20" FieldId="{3630d838-1a0d-4fcf-99d6-6d7636356d22}" PushDown="TRUE" />

The site columns will be deployed, but both fields will not be attached to the content type. Version number of the Solution and the Feature are the same:

"version": "1.1.0.0",
    "assets": {
      "elementManifests": [
        "elements.xml",
        "elements-v2.xml"
      ],
      "elementFiles":[
        "xxx.xml",
        "yyy.xml",
        "zzz.xml",
        "Documentation.docx"         
      ],
      "upgradeActions": [
        "upgrade-actions.xml"
      ]   
    }

The elements-v2.xml does contain the definition of my two new columns. If I now add this Package to a fresh Site, the new columns are deployed, but not attached to the site content type, nor pushing down to the list content type. All definitions and Guids have been verified. I can attach the columns by UI without any error. I always follow this approach, but this time, I don't see what might be wrong.

3
  • Can you confirm the GUID of the feature you included in the package-solution.json file? Does it match the value 5b1d5abd-297f-41e2-88d4-3c2fc9c23962?
    – Pradip R.
    Jul 14 at 14:28
  • Yes, checked that, otherwise the new fields could not be deployed.
    – Ronny
    Jul 14 at 15:21
  • Have you placed your AddContentTypeField within the UpgradeActions section? You can refer to the following link for more information: learn.microsoft.com/en-us/sharepoint/dev/schema/…
    – Pradip R.
    Jul 14 at 16:22

1 Answer 1

0

I am answering my own question. You need to add the new field also to the content type definition from the origin elements.xml, then the field will get attached to the content type when adding the update through UI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.