Normal Topic Button to create new ID number (Read 615 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Button to create new ID number
Dec 19th, 2005 at 8:16pm
Print Post Print Post  
This is such a basic idea that I'm sure it's been discussed elsewhere and there's probably been some code published, either in the Forum archives or in Inside Sesame, so probably all I need is a pointer.

Since a Sesame application can only use one @Number and since I'd like to create ID codes for Customers/Workorders/Invoices that increase numerically by 1 each time a new record is added, a button that does the following would be nice:

1. Looks up the highest previous ID number in the database
2. Increments it by 1
3. Puts the result in the current record's ID Number field
4. Saves the record
5. Advances to a new, blank record.

Any help would be appreciated, and in the meantime I'm scanning old posts to see if this has been discussed before.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Button to create new ID number
Reply #1 - Dec 19th, 2005 at 8:21pm
Print Post Print Post  
This doesn't include the Save and Advance, but here are a couple of OneSheets to get you started. Both of these are available from the Sesame Support Library.

Assign Next Number Using @XLookupR
http://www.lantica.com/Support/sesame_onesheet_11.html

Assign Next Number Using a Global Value
http://www.lantica.com/Support/sesame_onesheet_10.html

More OneSheets in the Sesame Support Library
http://www.lantica.com/Support/sesame_library.html
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Button to create new ID number
Reply #2 - Dec 19th, 2005 at 9:00pm
Print Post Print Post  
Thanks Erika, that's a great help!

  

**
Captain Infinity
Back to top
IP Logged