Skip to main content
3 of 3
added 13 characters in body
Dominic Cronin
  • 18.5k
  • 3
  • 23
  • 74

Unable to update a Keyword using SDL Tridon Core Service

I am trying to copy the Keyword value to a Metadata field value using the SDL Tridion Core Service. I am able to run my console app successfully without any error but I don't see the Metadata field value getting copied.

Below is my code. Please advise.

enter image description here

KeywordData currentKeyword = (KeywordData)client.TryCheckOut(keywordUri, readOptions);
string translatedTitle = currentKeyword.Title;

if (currentKeyword.MetadataSchema.IdRef != "tcm:0-0-0")
{
    SchemaFieldsData schemaFieldsData = 
       client.ReadSchemaFields(currentKeyword.MetadataSchema.IdRef, true, readOptions);
    SingleLineTextFieldDefinitionData test = new SingleLineTextFieldDefinitionData();
    test = (SingleLineTextFieldDefinitionData)schemaFieldsData.MetadataFields[0];
    test.DefaultValue = translatedTitle;
    currentKeyword = (KeywordData)client.Save(currentKeyword, readOptions); 
}
Vandana
  • 121
  • 2