No SharePoint 2013, o catálogo de produtos - como programaticamente adicionar uma tag à coluna de categoria de item na lista de produtos?

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/49328

  •  09-12-2019
  •  | 
  •  

Pergunta

Eu tenho um webPart personalizado para adicionar um item à lista de produtos, preciso de uma maneira de adicionar tags à coluna Catagory do item na lista (programaticamente).

Como faço isso!

Foi útil?

Solução 2

i figured out a way to do this TaxonomyFieldValueCollection TagsCat = new TaxonomyFieldValueCollection(String.Empty); TagsCat.PopulateFromLabelGuidPairs(TaxonomyWebTaggingControl1.Text);

                            var taxKeywordField = oSpListItem.Fields.GetField("ProductCatalogItemCategory") as TaxonomyField;
                            taxKeywordField.CreateValuesInEditForm = true;
                            try
                            {
                                taxKeywordField.ParseAndSetValue(oSpListItem, TagsCat[0].TermGuid);
                            }
                            catch (Exception e2)
                            {

                            }
                            oSpListItem.Update();

This worked for me

Outras dicas

Take a look at these scripts on TechNet. The script starting with 5 is updating the Item Category column. http://gallery.technet.microsoft.com/Import-list-content-to-f735d7fb

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top