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

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 advice. 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); 
}

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 advice.

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); 
}

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); 
}
Tweeted twitter.com/#!/StackTridion/status/383567108501954560
formatted code
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

Unable to update the keyworda Keyword using SDL Tridon Core serviceService

I am trying to copy the keywordKeyword value to the metadataa Metadata field value using the SDL Tridion core serviceCore Service.I I am able to run themy console app successfully without any error but iI don't see the metadata filedMetadata field value getgetting copied.Below

Below is my code, please advice. enter image description here

KeywordData currentKeyword = (KeywordData)client.TryCheckOut(keywordUri, readOptions); string translatedTitle = currentKeyword.Title;enter image description here

            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); 
            }
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); 
}

Unable to update the keyword using Tridon Core service

I am trying to copy the keyword value to the metadata field value using Tridion core service.I am able to run the console app successfully without any error but i don't see the metadata filed value get copied.Below is my code, please advice. 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); 
            }

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 advice.

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); 
}
Source Link
Vandana
  • 121
  • 2

Unable to update the keyword using Tridon Core service

I am trying to copy the keyword value to the metadata field value using Tridion core service.I am able to run the console app successfully without any error but i don't see the metadata filed value get copied.Below is my code, please advice. 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); 
            }