Book a Demo

Author Topic: Updating the Glossary  (Read 3283 times)

neil_albiston

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Updating the Glossary
« on: December 10, 2010, 10:56:09 pm »
I've put together a quick script to update our Project Glossary.

The 'add' works fine but I would like to check whether a term is already included before I add a duplicate.

The line Repository.Terms.GetByName returns a runtime error "Action is not supported."

I've tried with normal users and admin users but I always get the same error message. Any help or clues appreciated.

Code extract below......
var foundGlossary as EA.Term;
                  
foundGlossary = Repository.Terms.GetByName("Name1") ;
                  
if ( foundGlossary == null )
    {
      //Add ... this bit works OK.
       foundGlossary = Repository.Terms.AddNew("Name1","Term");
      foundGlossary.Meaning = "Meaning of Name1";
      foundGlossary.Type = "Business";
      foundGlossary.Update;
  }
.......
            

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Updating the Glossary
« Reply #1 on: December 13, 2010, 08:28:34 am »
GetByName is not supported for all collection types.  You'll need to iterate over the collection and check each name.