0

I'm having trouble figuring out how to rename a calculated column. The below code creates the 3 fields, and renames the first two but it won't rename the 3rd one.

<UpdateList xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <listName>listName</listName>';
    <newFields>
        <Fields>
            <Method ID="1">
                <Field Type="Text" DisplayName="nDingoMan" />
            </Method>
            <Method ID="2">
                <Field Type="Text" DisplayName="nBingoMan" />
            </Method>
            <Method ID="3">
                <Field Type="Calculated" DisplayName="nDingoBingoMan" ResultType="Text">
                    <Formula>=nDingoMan&amp;&quot;-&quot;&amp;nBingoMan</Formula>
                    <FieldRefs>
                        <FieldRef Name="nDingoMan"/>
                        <FieldRef Name="nBingoMan"/>
                    </FieldRefs>
                </Field>
            </Method>
        </Fields>
    </newFields>
    <updateFields>
        <Fields>
            <Method ID="4">
                <Field Type="Text" Name="nDingoMan" DisplayName="dingo man" />
            </Method>
            <Method ID="5">
                <Field Type="Text" Name="nBingoMan" DisplayName="bingo man" />
            </Method>
            <Method ID="6">
                <Field Type="Calculated" Name="nDingoBingoMan" DisplayName="dingo bingo man" />
            </Method>
        </Fields>
    </updateFields>
</UpdateList>

I've tried doing the newFields and updateFields in the same call and in different calls but no dice.

<UpdateList xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    <listName>listName</listName>';
    <updateFields>
        <Fields>
            <Method ID="1">
                <Field Type="Calculated" Name="nDingoBingoMan" DisplayName="dingo bingo man" />
            </Method>
        </Fields>
    </updateFields>
</UpdateList>
1

Try

<Method ID="6">
    <Field Type="Calculated" DisplayName="dingo bingo man" Name="nDingoBingoMan"  ResultType="Text" ReadOnly="TRUE">
        <Formula>=nDingoMan&amp;&quot;-&quot;&amp;nBingoMan</Formula>
        <FieldRefs>
            <FieldRef Name="nDingoMan"/>
            <FieldRef Name="nBingoMan"/>
        </FieldRefs>
    </Field>
</Method>
2
  • Thanks! In that case, is it possible in the newFields to create the CC with minimum information and then do the rest in the updateFields? That way I wouldn't have to provide the formula and fieldref information twice? May 29 '15 at 22:06
  • You need to provide Type, Formula, DisplayName and ResultType in create. May 29 '15 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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