Tuesday, June 7, 2011

SetFieldDefault Metadata - term default na folder/pasta ou field/campo

Para definir um term default na folder/pasta ou field/campo com metadata, utilizamos:

string term="";
MetadataDefaults metaDefault= new MetadataDefaults(properties.List);
SPFolder folder = web.GetFolder(properties.Web.GetFolder("http://server/site/folder"));
term = "2070;#Programas|bc943091-79ac-4f5f-a79b-205e8e717823";
metaDefault.SetFieldDefault(folder, "Categoria", term);


Term/Termo é composto por:
lcid
;#Term Name|Guid of term

LCID = Language code ID - How to get LCID
Guid of term = Term.id - How to get Guid of Term and term

Hope it helps ;))

No comments:

Post a Comment