Book a Demo

Author Topic: Collection.Delete internal application error  (Read 4695 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Collection.Delete internal application error
« on: April 25, 2013, 03:15:24 am »
Hi,

I've got a Collection of Elements by running the repository.GetElementsByQuery. This works fine i have a collection with the element i want in it.

I then try to invoke Collection.Delete or DeleteAt - both give me an "internal application exception". So how do i delete an Element ?

Does delete not work against a collection retreived via a query ?

Any ideas ? Is there a common/known reasons for this error when deleting ?

Appreciate any help,

Regards,

Jon.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Collection.Delete internal application error
« Reply #1 on: April 25, 2013, 05:16:42 am »
If you want to delete the element you need to retrieve it from its according collection (via parent and then elements, attributes or whatever).

q.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Collection.Delete internal application error
« Reply #2 on: April 25, 2013, 06:40:18 pm »
Thanks, i suspected as much.

@Sparx - a bit poor that you can retreive a collection via the query, but then can't delete elements in the collection !!??? At the very least you should update your documentation to highlight this ommision. Again it a bit poor that i can invoke the method but the only error message is an "internal application exception". Whilst i'm complaining :-) you might also want to make the doc wording for Delete and DeleteAt consistent. Its not currently. Delete implies the arg is an ID DeleteAt an index. Are they not both an index ?

Regards,

Jon.