في SharePoint 2013، كتالوج المنتجات - كيفية إضافة علامة برمجية إلى عمود فئة العنصر في قائمة المنتجات؟

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

  •  09-12-2019
  •  | 
  •  

سؤال

لدي WebPart مخصص لإضافة عنصر إلى قائمة المنتجات، أحتاج إلى طريقة لإضافة علامات إلى عمود Centagory في القائمة (برمجيا).

كيف أفعل ذلك!

هل كانت مفيدة؟

المحلول 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

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top