Tridion 2011 でコア サービスを使用してコンポーネントを更新しています。
サンプルコードは次のとおりです。
string COMPONENT_URI = "tcm:8-674";
string SCHEMA_URI = "tcm:8-426-8";
ComponentData component = client.TryCheckOut(COMPONENT_URI, null) as ComponentData;
try
{
Response.Write("<BR>" + component.Content);
XDocument xdoc = XDocument.Parse(component.Content);
var element = xdoc.Elements("first").Single();
element.Value = "updated";
xdoc.Save(component.Content);
client.Save(component, null);
Response.Write("<BR"+"SAVED");
}
catch (Exception ex)
{
Response.Write("Unable to save comp" + ex.Message);
}
client.CheckIn(COMPONENT_URI, null);
次の例外が発生しています:
Unable to save compSequence contains no elements
詳細:
first
- コンポーネント内のフィールドの名前
これに関して誰も助けることができますか?
ありがとうございました