I am trying to add some fields to list using the client object model. Everything is working except the Calculated field.
Every time SharePoint gives the error: An error occurred while parsing EntityName
fields.AddFieldAsXml(
"<Field Type='Calculated' DisplayName='Periode' LCID='1043' Name='Periode' ResultType='Text' ReadOnly='TRUE'><Formula>=RECHTS(\"00\"&MAAND([Rapportage periode]);2)&\"-\"&TEKST([Rapportage periode];\"YYYY\")&\"(\"&TEKST([Rapportage periode];\"MMMM\")&\")\"</Formula><FieldRefs><FieldRef Name='Rapportage periode' /></FieldRefs></Field>"
, true, AddFieldOptions.AddFieldToDefaultView);
My question is, What on earth am i doing wrong? I have tested the formula, and it works fine.
Further on, adding the column with the formula:
=[Rapportage periode]
works, adding the formula:
=RECHTS("00"&MAAND([Rapportage periode]);2)&"-"&TEKST([Rapportage periode];"YYYY")&" ("&TEKST([Rapportage periode];"MMMM")&")"
in the interface works.