Book a Demo

Author Topic: Autonumber  (Read 3752 times)

Gordon Muscroft

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Autonumber
« on: March 21, 2012, 06:44:17 am »
Hi;

I want to add a new "class" in EA, with a auto-increment using the API.
ProtoCode-example:

  EA.Element aElmnt;
  aElmnt= aElmntPackage.Elements.AddNew("Auto", "TypeName");
  aElement.Update();

The AddNew has a "Name" and "Type" parameter. I would like a way to auto-increment the name with the next number.. (Next sequence/autonumber)
(There are a bunch of hacks I can do/go to db, get next sequence number etc....)

Is there a "Baked-in" API way of doing this?

Thanks
Gord




qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Autonumber
« Reply #1 on: March 21, 2012, 08:11:48 am »
GUI yes, API no. But what is programming all about if not incrementing counters?

q.

Gordon Muscroft

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Autonumber
« Reply #2 on: March 23, 2012, 12:02:14 am »
Anyone know which table the next sequence number is kept in? I have been trying to find it anyway....

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Autonumber
« Reply #3 on: March 23, 2012, 02:20:32 am »
t_trxtypes

q.