-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
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
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- browser version : Version 127.0.2651.98 (Offizielles Build) (64-Bit)
- SPFx version 1.19.0
- Node.js version: 18.19.0
Describe the bug / error
A calculated field is not added to the content type even when defined in the elements.xml
Steps to reproduce
- Deploy two number fields
- Deploy a calculated field with resulttype=number which calculated the two previous mentioned fields
- Add these three fields to a content type which you attach to a custom list.
- After deployment you see that the calculated field has been deployed as site column, but is not attached to the content type.
- 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:
<Field ID="{c7bc0183-8ca4-46d5-b138-882e1033f573}" Name="IRCO2Impact" DisplayName="CO2-Impact in kg/Jahr (Einsparung (-) bzw. Mehrverbrauch (+))" Type="Calculated" ResultType="Number" ReadOnly="TRUE" Group="Invest"> <Formula>=IRCO2After-IRCO2Before</Formula> <FieldRefs> <FieldRef Name="IRCO2After"/> <FieldRef Name="IRCO2Before"/> </FieldRefs> </Field>
Content type definition part:
<FieldRef ID="{ed8aee2b-10c7-4dd0-bff1-5f240c8814f2}" Name="IRCO2Before" DisplayName="CO2-Verbrauch vor Investition"/> <FieldRef ID="{116ca0de-e899-45d8-9caf-21c821b46f00}" Name="IRCO2After" DisplayName="CO2-Verbrauch nach Investition"/> <FieldRef ID="{c7bc0183-8ca4-46d5-b138-882e1033f573}" Name="IRCO2Impact" DisplayName="CO2-Impact in kg/Jahr (Einsparung (-) bzw. Mehrverbrauch (+))"/>
Expected behavior
The calculated field should be attached to the content type.