Book a Demo

Author Topic: GetByName : Action is not supported  (Read 4664 times)

The apprentice

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
GetByName : Action is not supported
« on: May 23, 2018, 12:03:06 am »
Hi

I need to get a EA Attribut and I use GetByname but i have the same problem :

Code: [Select]
if (element.Attributes.GetByName(o) != null)

I didn't understand why "Action is not supported" despite the documentation of this operation.

Thank you.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: GetByName : Action is not supported
« Reply #1 on: May 23, 2018, 01:38:47 am »
What is "the same problem"? Any error messages?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GetByName : Action is not supported
« Reply #2 on: May 23, 2018, 02:03:58 am »
GetByName only works for a limited set of EA.Collections.

But I wouldn't use it anyway if I were you. It will only return the "first" element with the given name, but you don't know in which order that will be.

Better to pretend GetByName doesn't exist and always "for each" the collection and test for the name.

Geert

The apprentice

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: GetByName : Action is not supported
« Reply #3 on: May 23, 2018, 05:17:23 pm »
GetByName only works for a limited set of EA.Collections.

But I wouldn't use it anyway if I were you. It will only return the "first" element with the given name, but you don't know in which order that will be.

Better to pretend GetByName doesn't exist and always "for each" the collection and test for the name.

Geert

Okay good

What is "the same problem"? Any error messages?

q.

I had the following error : "Action is not suported" by using GetByName on EA.Attributes

Thank you