In SharePoint 2013, catalogo prodotti - Come aggiungere a livello di programmazione un tag alla colonna della categoria elemento nell'elenco dei prodotti?
-
09-12-2019 - |
Domanda
Ho un WebPart personalizzato per aggiungere un elemento all'elenco dei prodotti, ho bisogno di un modo per aggiungere tag alla colonna Catagory dell'articolo nell'elenco (a livello di programmazione).
Come faccio a farlo!
Soluzione 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
Altri suggerimenti
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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange