In SharePoint 2013, Produktkatalog - So fügen Sie der Position der Artikelkategorie in der Produktliste programmgesteuert hinzu?
-
09-12-2019 - |
Frage
Ich habe ein benutzerdefiniertes WebPart, um einem Artikel in der Produktliste hinzuzufügen. Ich brauche einen Weg, um der Position Catagory-Spalte in der Liste (programmgesteuert) Tags hinzuzufügen.
Wie mache ich es!
Lösung 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
Andere Tipps
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
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange