1

Currently I'm trying yo store custom values of terms in terms store,

.Terms Store

 .AAA(Group)

  .Location(TermSet)

   .StamFord(Term)

    .Mumbai

StamFord Location has a custom property ,trying to store that custom property programmatically. How can this be done?

1

The Term object contains a method called "SetCustomProperty(key, value)". Remember to commit your changes on the term object after setting or editing a custom property. The user running this code needs to be a TermStore Administrator, otherwise you will get a UnauthorizedException.

It could look like this:

termObject.SetCustomProperty("SomeKey", "Some Value");

try
{
    termObject.TermStore.CommitAll();
}
catch (Exception)
{
    termObject.TermStore.RollbackAll();
}
0

The property you're looking for is called a LocalCustomProperty or a SharedCustomProperty depending on which type of custom property you want to set.

Term documentation: MSDN

More specifically the Term.SetLocalCustomProperty method: MSDN

For apps / online: MSDN

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.