I am creating a calculated field like this:
<Field DisplayName="CalculatedIncidentStatus" ID="{19d86870-21ab-4395-a7bb-ff4955ae31be}" Name="CalculatedIncidentStatus" Group="COMAFI" Type="Calculated" ResultType="Text" ReadOnly="TRUE" StaticName="CalculatedIncidentStatus" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" Version="1" RowOrdinal="0">
<Formula>=IncidentStatus</Formula>
<FieldRefs>
<FieldRef Name="IncidentStatus" ID="{E7673592-95A0-4CB7-AE3A-D4489674F7D3}" />
</FieldRefs>
</Field>
My IncidentStatus column is a Choice, and I need to obtain it through ProjectedFields on a join function, so I needed to create a Calculated column that duplicates the Choice column, so I can add it to my ProjectedFields on the join caml query.
In the list I can see it correctly, and if I save an item with a value in my IncidentStatus column, the CalculatedIncidentStatus value is filled perfectly.
Here's the thing: the first time I publish my column, if I run the caml query it doesn't bring any results but if I edit the column in the list through my sharepoint site (not changing anything, just entering and saving the column), it starts working as expected. It seems that I am not creating the column correctly, but it saves the data fine before editing it. Weird....
I exported the list after the edition, and copied the creation of the column but still no luck
Thank you in advance for the help!
No comments:
Post a Comment