1

I just want to display data from another column. So i write following field declaration:

<Field ID = "{254BCC65-92DC-4c1b-90CC-8E11E4831CD1}"
      Name="NewName"
      StaticName="NewName"
      DisplayName="Calculated Text"
      Group="$Resources:gh;"
      Type="Calculated"
      Description="A calculated text field based on Custom Single Line of Text."
      Required="FALSE"
      ResultType="Text"
      ShowInNewForm="TRUE"
      ShowInEditForm="TRUE">
    <Formula>=[Measure_Type]</Formula>
    <FieldRefs>
        <FieldRef ID="{B1F9DE38-0B0D-4F7B-BECF-8C830E8583EC}" Name="Measure_Type"/>
    </FieldRefs>
</Field>

where measure type is just a text column:

<Field ID="{B1F9DE38-0B0D-4F7B-BECF-8C830E8583EC}"
         Name="Measure_Type"
         StaticName="Measure_Type"
         Required="FALSE"
         DisplayName="$Resources:asfasfasf;"
         Group="$Resources:gh;"
         Type="Text" />

but when I deploy it it just doesn't create anything, just blank stroke instead of column name: enter image description here

when I click I get an error: "cannot display filter value. Filtering is impossible or exeeds a threshold".

  • Do you have resource files associated with those entries ? (DisplayName="$Resources:asfasfasf;") – JayHell Aug 3 '15 at 17:18
  • Of course, it works for text field type. – Alex Zhukovskiy Aug 6 '15 at 7:38
1

First, I would remove the "$Resources" part in the Display Name of your definitions (if you don't use resource files).

Check this question : How can I provision a list with a calculated field?

(there is a comment saying that InternalNames are required, and there is this link http://www.hekstra.org/how-to-deploy-a-calculated-field/ saying that Site Column = InternalName and List Column = DisplayName)

The reason seems to be that you have to use the DisplayName in your formula instead on the InternalName.

  • Thanks for links, especially for FormulaDisplayNames, but it didn't work for me – Alex Zhukovskiy Aug 6 '15 at 9:10
1

It has been a while since I did this.

I agree with taking out the $Resource part.

And yes Formulas use DisplayName as references, I have never used the ID in the FieldRefs

And try it with an existing field first

<Field>
...
<Formula>=Title</Formula>
<FieldRefs>
  <FieldRef Name="Title" />
</FieldRefs>
</Field>

If this doesn't work your error is not with the Formula

Trace from my own CalcMaster App

I add a trace from my CalcMaster App I built some time ago; I use it to work on (new) Calculated Columns. This is the Schema that works for me:

<Field Title="MyColumn" 
    Type="Calculated" 
    JSLink="" 
    Name="MyColumn" 
    DisplayName="MyColumn" 
    DateFormat="0" 
    InternalName="MyColumn" 
    StaticName="MyColumn" 
    Required="FALSE" 
    FilterAble="TRUE" 
    ResultType="Text" 
    Sealed="FALSE" 
    AllowDeletion="TRUE" 
    ReadOnly="TRUE" 
    Viewable="TRUE" 
    Hidden="FALSE" 
    ShowInDisplayForm="FALSE" 
    ShowInEditForm="FALSE" 
    ShowInNewForm="FALSE" 
    ShowInListSettings="TRUE" 
    ShowInViewForms="TRUE" 
    Group="_ViewMaster365.com" 
    ClassInfo="ViewMasters" 
    Description="" 
    AuthoringInfo="- editted by the CalcMaster App" 
    Tag="" 
    OutputType="Text" 
    ID="{a8bbf0f1-2b95-461a-9a5f-860ba348850b}" 
    SourceID="{e15e9a9a-127b-4e87-8ba4-731335bb96e5}" 
    ColName="sql_variant4" 
    RowOrdinal="0" 
    Version="1">
<Formula>=Title</Formula>
<FieldRefs>
    <FieldRef Name="Title" />
</FieldRefs>
</Field>

note, I have stuffed some of my own attributes in here, that get ignored by SharePoint; I just don't know exaclty which ones, haven't been in the bowels of this App in some time :-/

  • Well, what should I do if i have localised displayname? Because i tried "Title" and localised value both and they didn't work. – Alex Zhukovskiy Aug 6 '15 at 7:39

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.