Quantcast
Channel: Question and Answer » web-services
Viewing all articles
Browse latest Browse all 136

How do I rename a calculated column using SharePoint 2010 list webservices

$
0
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>

Viewing all articles
Browse latest Browse all 136

Trending Articles