SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Calculated field not added to content type with feature deployment #9871

Open EA12 opened 3 months ago

EA12 commented 3 months ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

πŸ’₯ SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

Additional environment details

Describe the bug / error

A calculated field is not added to the content type even when defined in the elements.xml

Steps to reproduce

  1. Deploy two number fields
  2. Deploy a calculated field with resulttype=number which calculated the two previous mentioned fields
  3. Add these three fields to a content type which you attach to a custom list.
  4. After deployment you see that the calculated field has been deployed as site column, but is not attached to the content type.
  5. It is then possible to manually add the calculated field to the content type by UI

Field Definition: <Field ID="{ed8aee2b-10c7-4dd0-bff1-5f240c8814f2}" Name="IRCO2Before" DisplayName="CO2-Verbrauch vor Investition" Type="Number" Decimals="0" Min="0" Group="Invest" /> <Field ID="{116ca0de-e899-45d8-9caf-21c821b46f00}" Name="IRCO2After" DisplayName="CO2-Verbrauch nach Investition" Type="Number" Decimals="0" Min="0" Group="Invest" />

Calculated field definition: `

=IRCO2After-IRCO2Before
<FieldRefs>
    <FieldRef Name="IRCO2After"/>
    <FieldRef Name="IRCO2Before"/>
</FieldRefs>

`

Content type definition part: `

`

Expected behavior

The calculated field should be attached to the content type.

EA12 commented 3 months ago

Hello? Nobody from MS?

EA12 commented 1 month ago

Hello? Nobody?